From 0dab2c5bc1bc7b424ec7d04a1089fa181ca89082 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 9 Dec 2008 07:39:24 +0100 Subject: [PATCH] ao: use 16 bit sample format There have been bug reports on MPD regarding 24 bit output via libao/esd. The "ao" plugin does not attempt fall back to 16 bit currently, and thus fails to play 24 bit audio (i.e. all mp3 files). Make it always use 16 bit samples for now, until more bits are well-tested. --- src/output/ao_plugin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/output/ao_plugin.c b/src/output/ao_plugin.c index 3907448ae..4c69592ff 100644 --- a/src/output/ao_plugin.c +++ b/src/output/ao_plugin.c @@ -201,6 +201,12 @@ audioOutputAo_openDevice(void *data, struct audio_format *audio_format) audioOutputAo_closeDevice(ad); } + /* support for 24 bit samples in libao is currently dubious, + and until we have sorted that out, resample everything to + 16 bit */ + if (audio_format->bits > 16) + audio_format->bits = 16; + format.bits = audio_format->bits; format.rate = audio_format->sample_rate; format.byte_format = AO_FMT_NATIVE;