aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-08-07 17:51:15 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-08-07 17:51:15 +0000
commitff0a2543a60def86d44e789fdc9a50c2bda25788 (patch)
treea3880f10092cd814094ff5c0f6575739d82ee456 /src/audio.c
parent7f4f3010a5cba4346c74646c5419ce782bf434d0 (diff)
downloadmpd-ff0a2543a60def86d44e789fdc9a50c2bda25788.tar.gz
mpd-ff0a2543a60def86d44e789fdc9a50c2bda25788.tar.xz
mpd-ff0a2543a60def86d44e789fdc9a50c2bda25788.zip
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
Diffstat (limited to 'src/audio.c')
-rw-r--r--src/audio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/audio.c b/src/audio.c
index 306f0022d..d17679969 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -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;