From 266d8368e82bbede6a087b6c83a1066fc5d91b9c Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Jan 2016 13:43:43 +0100 Subject: audio: fix spdif PCM fallback With the format left untouched, this would just try to reinit with a spdif format again. We're not clearing the format in reset_audio_state() so the audio chain can be recreated any time without having to wait for a frame to be decoded. --- player/audio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/player/audio.c b/player/audio.c index 932d38a14b..47acffb8b7 100644 --- a/player/audio.c +++ b/player/audio.c @@ -346,12 +346,14 @@ void reinit_audio_chain(struct MPContext *mpctx) if (!mpctx->ao) { // If spdif was used, try to fallback to PCM. if (spdif_fallback) { + MP_VERBOSE(mpctx, "Falling back to PCM output.\n"); ao_c->spdif_passthrough = false; ao_c->spdif_failed = true; ao_c->audio_src->try_spdif = false; if (!audio_init_best_codec(ao_c->audio_src)) goto init_error; reset_audio_state(mpctx); + ao_c->input_format = (struct mp_audio){0}; reinit_audio_chain(mpctx); return; } -- cgit v1.2.3