Reopen the audio device if the audio format has changed

git-svn-id: https://svn.musicpd.org/mpd/trunk@4584 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2006-08-07 17:51:15 +00:00
parent 7f4f3010a5
commit ff0a2543a6

View File

@ -277,6 +277,10 @@ static void syncAudioDeviceStates(void)
return;
for (i = audioOutputArraySize; --i >= 0; ) {
switch (audioDeviceStates[i]) {
case DEVICE_ON:
/* This will reopen only if the audio format changed */
openAudioOutput(&audioOutputArray[i], &audio_format);
break;
case DEVICE_ENABLE:
openAudioOutput(&audioOutputArray[i], &audio_format);
audioDeviceStates[i] = DEVICE_ON;