]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Abort from snd_pcm_dshare_drain in XRUN state
authorTakashi Iwai <tiwai@suse.de>
Mon, 21 Nov 2005 10:51:43 +0000 (10:51 +0000)
committerTakashi Iwai <tiwai@suse.de>
Mon, 21 Nov 2005 10:51:43 +0000 (10:51 +0000)
Fixed the hang-up in snd_pcm_dshare_drain() when the state is XRUN.

src/pcm/pcm_dshare.c

index 8d58ecce955452ff56ebf5f3aa5f3a39c9196ffb..aebe64c4cf8353a678a0cd6732a5d08768db3261 100644 (file)
@@ -385,6 +385,12 @@ static int snd_pcm_dshare_drain(snd_pcm_t *pcm)
                        return 0;
                }
        }
+
+       if (dshare->state == SND_PCM_STATE_XRUN) {
+               snd_pcm_dshare_drop(pcm);
+               return 0;
+       }
+
        stop_threshold = pcm->stop_threshold;
        if (pcm->stop_threshold > pcm->buffer_size)
                pcm->stop_threshold = pcm->buffer_size;