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.
This commit is contained in:
Max Kellermann 2008-10-29 18:35:03 +01:00
parent c6714f1755
commit 5c4dc8d03c

View File

@ -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)) {