diff options
author | wm4 <wm4@nowhere> | 2015-11-18 20:58:07 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-11-18 20:58:07 +0100 |
commit | 76fcef618b2f4e3ea7792866ed8eb74db356e152 (patch) | |
tree | 2ebcc64e47102041b87f871b72067f8fce0fd757 /player/playloop.c | |
parent | 74c862c68ededa2d2abf29df62d338cef9b8015f (diff) | |
download | mpv-76fcef618b2f4e3ea7792866ed8eb74db356e152.tar.bz2 mpv-76fcef618b2f4e3ea7792866ed8eb74db356e152.tar.xz |
player: make timeline switching slightly nicer
But not much.
Diffstat (limited to 'player/playloop.c')
-rw-r--r-- | player/playloop.c | 14 |
1 files changed, 5 insertions, 9 deletions
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; |