[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.32,1.33

Moritz Bunkus CVS mosu at mplayerhq.hu
Mon Sep 15 23:04:17 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv29868

Modified Files:
	demux_mkv.cpp 
Log Message:
Different decision making for seeking which takes the direction into account.

Index: demux_mkv.cpp
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- demux_mkv.cpp	12 Sep 2003 21:56:03 -0000	1.32
+++ demux_mkv.cpp	15 Sep 2003 21:03:49 -0000	1.33
@@ -2426,9 +2426,28 @@
           if (!index->entries[k].is_key)
             continue;
           diff = target_timecode - (int64_t)index->entries[k].timecode;
-          if ((diff > 0) && (diff < min_diff)) {
+          if ((target_timecode <= (mkv_d->last_pts * 1000)) &&
+              (diff >= 0) && (diff < min_diff)) {
             min_diff = diff;
-            entry = & index->entries[k];
+            entry = &index->entries[k];
+            mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] seek BACK, solution: last_pts: "
+                   "%d, target: %d, diff: %d, entry->timecode: %d, PREV diff: "
+                   "%d, k: %d\n", (int)(mkv_d->last_pts * 1000),
+                   (int)target_timecode, (int)diff, (int)entry->timecode,
+                   k > 0 ? (int)(index->entries[k - 1].timecode -
+                                 target_timecode) : 0, k);
+                   
+          } else if ((target_timecode > (mkv_d->last_pts * 1000)) &&
+                     (diff < 0) && (-diff < min_diff)) {
+            min_diff = -diff;
+            entry = &index->entries[k];
+            mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] seek FORW, solution: last_pts: "
+                   "%d, target: %d, diff: %d, entry->timecode: %d, NEXT diff: "
+                   "%d, k: %d\n", (int)(mkv_d->last_pts * 1000),
+                   (int)target_timecode, (int)diff, (int)entry->timecode,
+                   k < index->num_entries ?
+                   (int)(index->entries[k + 1].timecode - target_timecode) :
+                   0, k);
           }
         }
         break;



More information about the MPlayer-cvslog mailing list