changeset 19811:ed853180b3b9

Fix seeking in Matroska files with non-default TimecodeScale value.
author eugeni
date Tue, 12 Sep 2006 21:45:06 +0000
parents 7dfc3d2bb54b
children 30349b8fe806
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Tue Sep 12 21:40:01 2006 +0000
+++ b/libmpdemux/demux_mkv.c	Tue Sep 12 21:45:06 2006 +0000
@@ -3660,7 +3660,8 @@
           for (i=0; i < mkv_d->num_indexes; i++)
             if (mkv_d->indexes[i].tnum == demuxer->video->id)
               {
-                diff = target_timecode + mkv_d->first_tc - (int64_t) mkv_d->indexes[i].timecode;
+                diff = target_timecode + mkv_d->first_tc -
+                       (int64_t) mkv_d->indexes[i].timecode * mkv_d->tc_scale / 1000000.0;
 
                 if ((flags & 1 || target_timecode <= mkv_d->last_pts*1000)
                     && diff >= 0 && diff < min_diff)