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