From 5c4dc8d03c8cfc77311a7f63282a35c9c7b82d1f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 Oct 2008 18:35:03 +0100 Subject: oss: check and override audio_format properly Don't accept 24 bit audio. Force MPD to use 16 bit if anything other than 8 or 16 bit is selected. --- src/output/oss_plugin.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c index 53d047101..2992368d9 100644 --- a/src/output/oss_plugin.c +++ b/src/output/oss_plugin.c @@ -471,6 +471,13 @@ static int oss_open(OssData *od) break; case 16: tmp = AFMT_S16_MPD; + break; + + default: + /* not supported by OSS - fall back to 16 bit */ + od->audio_format.bits = 16; + tmp = AFMT_S16_MPD; + break; } if (setParam(od, SNDCTL_DSP_SAMPLESIZE, &tmp)) { -- cgit v1.2.3