aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutputs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audioOutputs/audioOutput_alsa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/audioOutputs/audioOutput_alsa.c b/src/audioOutputs/audioOutput_alsa.c
index bc727c556..3abd81f31 100644
--- a/src/audioOutputs/audioOutput_alsa.c
+++ b/src/audioOutputs/audioOutput_alsa.c
@@ -315,6 +315,11 @@ static int alsa_errorRecovery(AlsaData * ad, int err) {
case SND_PCM_STATE_XRUN:
err = snd_pcm_prepare(ad->pcmHandle);
break;
+ case SND_PCM_STATE_DISCONNECTED:
+ /* so alsa_closeDevice won't try to drain: */
+ snd_pcm_close(ad->pcmHandle);
+ ad->pcmHandle = NULL;
+ break;
default:
/* unknown state, do nothing */
break;