From bdb9b1d5dcdb46b5cadcfb3642a29e5e8d8e424b Mon Sep 17 00:00:00 2001 From: eugeni Date: Fri, 18 Aug 2006 12:20:43 +0000 Subject: [PATCH] Fix seeking in matroska files when timecodes do not start from zero. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19436 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_mkv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index e60b7a8c04..e3f5c5386b 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -3606,7 +3606,7 @@ demux_mkv_seek (demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int for (i=0; i < mkv_d->num_indexes; i++) if (mkv_d->indexes[i].tnum == demuxer->video->id) { - diff = target_timecode - (int64_t) mkv_d->indexes[i].timecode; + diff = target_timecode + mkv_d->first_tc - (int64_t) mkv_d->indexes[i].timecode; if ((flags & 1 || target_timecode <= mkv_d->last_pts*1000) && diff >= 0 && diff < min_diff)