From 1f436f65f2ee4df6419ca68bd6426b8283db6d22 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 28 Feb 2016 20:29:51 +0100 Subject: 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. --- video/decode/dec_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3