summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-28 20:29:51 +0100
committerwm4 <wm4@nowhere>2016-02-28 20:29:51 +0100
commit1f436f65f2ee4df6419ca68bd6426b8283db6d22 (patch)
treee682d41f0c292b5ff480f50f80178eaacd33a784
parent90010836852927833f1f8afca28489382ff4dd83 (diff)
downloadmpv-1f436f65f2ee4df6419ca68bd6426b8283db6d22.tar.bz2
mpv-1f436f65f2ee4df6419ca68bd6426b8283db6d22.tar.xz
video: fix hr-seek
Hr-seek was often off by one frame due to rounding issues, which have been traditionally taken care off by adding a "tolerance". Essentially, frames very close to the seek target PTS are not dropped, even if they may strictly are before the seek target. Commit 0af53353 accidentally removed this by always removing frames even if they're within the "tolerance". Fix this by "unsharing" the logic and making sure the segment code is inactive for normal seeks.
-rw-r--r--video/decode/dec_video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index 80b5379d2d..e8a57749ab 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -432,7 +432,9 @@ void video_work(struct dec_video *d_video)
if (d_video->current_mpi && d_video->current_mpi->pts != MP_NOPTS_VALUE) {
double vpts = d_video->current_mpi->pts;
segment_ended = d_video->end != MP_NOPTS_VALUE && vpts >= d_video->end;
- if ((start_pts != MP_NOPTS_VALUE && vpts < start_pts) || segment_ended) {
+ if ((d_video->start != MP_NOPTS_VALUE && vpts < d_video->start)
+ || segment_ended)
+ {
talloc_free(d_video->current_mpi);
d_video->current_mpi = NULL;
}