diff options
author | wm4 <wm4@nowhere> | 2014-11-25 18:15:45 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-11-25 18:15:45 +0100 |
commit | e1ae936e6bc693b0b957a10b7c6689a6e4d81814 (patch) | |
tree | f8f4b3b1c27c2352301606854b248bfeaf00d155 /audio | |
parent | 5d5f5b094b7e238fc2b0c996bc4baeed23b085dc (diff) |
ao_alsa: always enable "plug" plugin for non-default device
This seems safer: otherwise, opening the AO could randomly fail if the
audio formats happens to be not float.
Unfortunately, this only works if the user does not select a device.
Since ALSA devices are arbitrary strings, including plugins with complex
parameters, it's not trivial or maybe even impossible to edit the string
in a way the "plug" plugin is added.
With --audio-device, it would be safe for users to select either
"default" or one of the "plughw" devices. Everything else seems
questionable.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_alsa.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 2cee7170a5..795894a4c6 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -457,10 +457,9 @@ static int init(struct ao *ao) ao->channels.num); } else { device = select_chmap(ao, &implied_chmap); - if (strcmp(device, "default") != 0 && (ao->format & AF_FORMAT_F)) { - // hack - use the converter plugin (why the heck?) + // Not-default likely means a hw device - enable software conversions. + if (strcmp(device, "default") != 0) device = talloc_asprintf(ao, "plug:%s", device); - } } if (ao->device) device = ao->device; |