aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2007-06-08 12:44:38 +0000
committerWarren Dukes <warren.dukes@gmail.com>2007-06-08 12:44:38 +0000
commit52a06531fc3b224994bbd258a061dc1a298ce583 (patch)
tree020ec9d570dd8291f07c0cc2e51d415a3f08e705 /src/audioOutputs
parentdf95a80fa10a7fe79e2142ab83afef926158ee23 (diff)
downloadmpd-52a06531fc3b224994bbd258a061dc1a298ce583.tar.gz
mpd-52a06531fc3b224994bbd258a061dc1a298ce583.tar.xz
mpd-52a06531fc3b224994bbd258a061dc1a298ce583.zip
dmix fix, don't call snd_pcm_drain unless we're already in the RUNNING
state (when users press stop, previous snd_pcm_drop(), then snd_pcm_drain() was called. this would lockup dmix) git-svn-id: https://svn.musicpd.org/mpd/trunk@6517 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/audioOutputs')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index 3ade3df46..8c8f73b42 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -370,7 +370,9 @@ static void alsa_closeDevice(AudioOutput * audioOutput)
AlsaData *ad = audioOutput->data;
if (ad->pcmHandle) {
- snd_pcm_drain(ad->pcmHandle);
+ if (snd_pcm_state(ad->pcmHandle) == SND_PCM_STATE_RUNNING) {
+ snd_pcm_drain(ad->pcmHandle);
+ }
snd_pcm_close(ad->pcmHandle);
ad->pcmHandle = NULL;
}