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.
This commit is contained in:
wm4 2017-09-03 13:09:49 +02:00
parent 650d4e3401
commit 181b071431
1 changed files with 3 additions and 3 deletions

View File

@ -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;