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.
This commit is contained in:
wm4 2016-02-28 20:29:51 +01:00
parent 9001083685
commit 1f436f65f2
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}