From ec431956337bc73fab0e99ae3debcdca5ccb195a Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 17 Mar 2016 13:56:15 +0100 Subject: [PATCH] [alsa] Really don't query snd_pcm_delay() during an underrun --- src/laudio_alsa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/laudio_alsa.c b/src/laudio_alsa.c index 436d8e6b..99daa528 100644 --- a/src/laudio_alsa.c +++ b/src/laudio_alsa.c @@ -295,6 +295,9 @@ laudio_alsa_get_pos(void) if (pcm_last_error != 0) return pcm_pos; + if (snd_pcm_state(hdl) != SND_PCM_STATE_RUNNING) + return pcm_pos; + ret = snd_pcm_delay(hdl, &delay); if (ret < 0) {