diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-01-26 22:16:51 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-01-26 22:16:51 +0000 |
commit | ad6e6a54ae9e27116965028fdafbae7198a17bb6 (patch) | |
tree | f700c7db24645d66ede1aa872b6bcd542acfaa58 | |
parent | eda485afab60e0f4913ccd8ae7b886d081356b1f (diff) | |
download | mpd-ad6e6a54ae9e27116965028fdafbae7198a17bb6.tar.gz mpd-ad6e6a54ae9e27116965028fdafbae7198a17bb6.tar.xz mpd-ad6e6a54ae9e27116965028fdafbae7198a17bb6.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)
From shank, r6517 in trunk
git-svn-id: https://svn.musicpd.org/mpd/branches/branch-0.13.0-fixes@7161 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/audioOutputs/audioOutput_alsa.c | 4 |
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; } |