summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-12-15 16:27:09 +0200
committerwm4 <wm4@nowhere>2013-01-13 13:25:50 +0100
commitc1232c9a01b7a6ae70fb0f919a4a6ffec986c613 (patch)
treec7a04008df548272cfd59a45d8133c754c88b577 /core
parent3996e8882d4495c224aba66bf6447d4161521d5b (diff)
downloadmpv-c1232c9a01b7a6ae70fb0f919a4a6ffec986c613.tar.bz2
mpv-c1232c9a01b7a6ae70fb0f919a4a6ffec986c613.tar.xz
core: timeline: prevent inaccurate seeks outside timeline
Ensure that even if a seek is inaccurate it will not show video from outside the defined timeline. Previously, seeking to the beginning of a segment could show frames from before the start of the segment if the seek was done in inaccurate mode and the demuxer seeked to an earlier position. Now hr-seek machinery is used to skip at least the frames that should not be part of playback timeline at all.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 2e445cf81e..008a783d73 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -2881,10 +2881,11 @@ static int seek(MPContext *mpctx, struct seek_params seek,
} else
mpctx->last_seek_pts = MP_NOPTS_VALUE;
- if (hr_seek) {
+ if (hr_seek || mpctx->timeline) {
mpctx->hrseek_active = true;
mpctx->hrseek_framedrop = true;
- mpctx->hrseek_pts = seek.amount;
+ mpctx->hrseek_pts = hr_seek ? seek.amount
+ : mpctx->timeline[mpctx->timeline_part].start;
}
mpctx->start_timestamp = GetTimerMS();