From e1ae936e6bc693b0b957a10b7c6689a6e4d81814 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 25 Nov 2014 18:15:45 +0100 Subject: 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. --- audio/out/ao_alsa.c | 5 ++--- 1 file 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; -- cgit v1.2.3