0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
Uoti Urpala 2012-12-15 16:27:09 +02:00 committed by wm4
parent 3996e8882d
commit c1232c9a01

View File

@ -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();