From 60a0db39aa649fd3f76f6cb7ce53f0f9c3ab6eb4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 3 Jun 2019 02:05:52 +0200 Subject: player: ensure backward playback state is propagated on track switching Track switching doesn't run reset_playback_state(), so a track enabled at runtime during backward playback would lead to a messed up state. This commit just does a bad code monkey fix to this. It feels like there needs to be a much better way to propagate this state. --- player/audio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'player/audio.c') diff --git a/player/audio.c b/player/audio.c index d56b97c5ba..881d74a904 100644 --- a/player/audio.c +++ b/player/audio.c @@ -187,8 +187,12 @@ static void ao_chain_reset_state(struct ao_chain *ao_c) void reset_audio_state(struct MPContext *mpctx) { - if (mpctx->ao_chain) + if (mpctx->ao_chain) { ao_chain_reset_state(mpctx->ao_chain); + struct track *t = mpctx->ao_chain->track; + if (t && t->dec) + t->dec->play_dir = mpctx->play_dir; + } mpctx->audio_status = mpctx->ao_chain ? STATUS_SYNCING : STATUS_EOF; mpctx->delay = 0; mpctx->audio_drop_throttle = 0; -- cgit v1.2.3