mirror of https://github.com/mpv-player/mpv
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:
parent
3996e8882d
commit
c1232c9a01
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue