aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
}