pulse: force 16 bit audio sample format

PA_SAMPLE_S16NE is the only sample format which is suported by both
MPD and pulseaudio.  Unfortunately, pulse does not accept 24 bit
samples.

Instead of bailing out with an error message, we should tell the MPD
core to convert all samples to 16 bit for pulse.
This commit is contained in:
Max Kellermann 2008-10-25 20:41:28 +02:00
parent 0fd6fa9927
commit a02db57291
1 changed files with 3 additions and 5 deletions

View File

@ -131,11 +131,9 @@ static int pulse_openDevice(void *data,
pd->connAttempts++;
pd->lastAttempt = t;
if (audioFormat->bits != 16) {
ERROR("PulseAudio doesn't support %i bit audio\n",
audioFormat->bits);
return -1;
}
/* MPD doesn't support the other pulseaudio sample formats, so
we just force MPD to send us everything as 16 bit */
audioFormat->bits = 16;
ss.format = PA_SAMPLE_S16NE;
ss.rate = audioFormat->sample_rate;