summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-09-03 13:09:49 +0200
committerwm4 <wm4@nowhere>2017-09-03 13:09:49 +0200
commit181b0714312eec2b44ba974eb3de6f378da92b14 (patch)
tree589e1b65d55e6a955fd1120992f647d61cd0e9af
parent650d4e34011bdd19750f45d393f231bcaca0b7b3 (diff)
downloadmpv-181b0714312eec2b44ba974eb3de6f378da92b14.tar.bz2
mpv-181b0714312eec2b44ba974eb3de6f378da92b14.tar.xz
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.
-rw-r--r--player/audio.c6
1 files 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;