From 44da7540181dc4d9d113ed617c92949797309691 Mon Sep 17 00:00:00 2001 From: llyyr Date: Tue, 10 Sep 2024 19:02:56 +0530 Subject: [PATCH] ao_alsa: don't early exit out of the loop if we have an error This would cause us to exit out of the loop with a goto anytime we ran into XRUN or DRAINING and preparing PCM for use failed. --- audio/out/ao_alsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 92ea0db237..35cae353d9 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -959,7 +959,8 @@ static bool recover_and_get_state(struct ao *ao, struct mp_pcm_state *state) case SND_PCM_STATE_XRUN: case SND_PCM_STATE_DRAINING: err = snd_pcm_prepare(p->alsa); - CHECK_ALSA_ERROR("pcm prepare error"); + if (err < 0) + MP_ERR(ao, "pcm prepare error: %s\n", snd_strerror(err)); continue; // Hardware suspend. case SND_PCM_STATE_SUSPENDED: