From 181b0714312eec2b44ba974eb3de6f378da92b14 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 3 Sep 2017 13:09:49 +0200 Subject: audio: fix format change regression Ever since the mp_aframe change, audio mid-stream format changes crash. I have no idea why the recent mp_aframe change triggers this. Didn't look too deeply into it either. It appears to work now, though. Fixes #4828. --- player/audio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/player/audio.c b/player/audio.c index 25d7baa6af..4c1ba90d35 100644 --- a/player/audio.c +++ b/player/audio.c @@ -389,9 +389,6 @@ static void reinit_audio_filters_and_output(struct MPContext *mpctx) struct track *track = ao_c->track; struct af_stream *afs = ao_c->af; - if (ao_c->input_frame) - mp_aframe_config_copy(ao_c->input_format, ao_c->input_frame); - if (!mp_aframe_config_is_valid(ao_c->input_format)) { // We don't know the audio format yet - so configure it later as we're // resyncing. fill_audio_buffers() will call this function again. @@ -843,6 +840,9 @@ static int decode_new_frame(struct ao_chain *ao_c) res = audio_get_frame(ao_c->audio_src, &ao_c->input_frame); } + if (ao_c->input_frame) + mp_aframe_config_copy(ao_c->input_format, ao_c->input_frame); + switch (res) { case DATA_OK: return AD_OK; case DATA_WAIT: return AD_WAIT; -- cgit v1.2.3