From c1ea63fa7a5ded2920a359b3ae9e303cd1962cc6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 22 Oct 2020 09:16:45 +0200 Subject: [PATCH] alsa-pcm: try to recover in all cases Even if we can't get the current status, still try to recover the device. See #347 --- spa/plugins/alsa/alsa-pcm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index ed22d47d6..2601b6580 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -620,7 +620,7 @@ static int alsa_recover(struct state *state, int err) if (SPA_UNLIKELY((res = snd_pcm_status(state->hndl, status)) < 0)) { spa_log_error(state->log, NAME" %p: snd_pcm_status error: %s", state, snd_strerror(res)); - return res; + goto recover; } st = snd_pcm_status_get_state(status); @@ -652,6 +652,7 @@ static int alsa_recover(struct state *state, int err) break; } +recover: if (SPA_UNLIKELY((res = snd_pcm_recover(state->hndl, err, true)) < 0)) { spa_log_error(state->log, NAME" %p: snd_pcm_recover error: %s", state, snd_strerror(res));