From 76fcef618b2f4e3ea7792866ed8eb74db356e152 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Nov 2015 20:58:07 +0100 Subject: player: make timeline switching slightly nicer But not much. --- player/playloop.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'player/playloop.c') diff --git a/player/playloop.c b/player/playloop.c index da21c64d34..5efb048cb2 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -228,15 +228,11 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek, hr_seek &= seek.type == MPSEEK_ABSOLUTE; // otherwise, no target PTS known double demuxer_amount = seek.amount; - if (mpctx->timeline) { - int segment = timeline_get_for_time(mpctx, seek.amount); - if (segment != mpctx->timeline_part) { - timeline_set_part(mpctx, segment, false); - reinit_video_chain(mpctx); - reinit_audio_chain(mpctx); - reinit_subs(mpctx, 0); - reinit_subs(mpctx, 1); - } + if (timeline_switch_to_time(mpctx, seek.amount)) { + reinit_video_chain(mpctx); + reinit_audio_chain(mpctx); + reinit_subs(mpctx, 0); + reinit_subs(mpctx, 1); } int demuxer_style = 0; -- cgit v1.2.3