# HG changeset patch # User eugeni # Date 1158097506 0 # Node ID ed853180b3b9ccf62468f24fc4a3d9cce5cf4ab6 # Parent 7dfc3d2bb54b6b0028ff4fa2fc903d67b3ca47e0 Fix seeking in Matroska files with non-default TimecodeScale value. diff -r 7dfc3d2bb54b -r ed853180b3b9 libmpdemux/demux_mkv.c --- 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)