[FFmpeg-cvslog] r15282 - in trunk: libavformat/matroskadec.c tests/seek.regression.ref

aurel subversion
Tue Sep 9 14:01:51 CEST 2008


Author: aurel
Date: Tue Sep  9 14:01:51 2008
New Revision: 15282

Log:
matroskadec: after seeking, skeep up to the desired timestamp instead of
the desired stream


Modified:
   trunk/libavformat/matroskadec.c
   trunk/tests/seek.regression.ref

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	(original)
+++ trunk/libavformat/matroskadec.c	Tue Sep  9 14:01:51 2008
@@ -210,7 +210,7 @@ typedef struct {
 
     /* What to skip before effectively reading a packet. */
     int skip_to_keyframe;
-    AVStream *skip_to_stream;
+    uint64_t skip_to_timecode;
 } MatroskaDemuxContext;
 
 typedef struct {
@@ -1467,7 +1467,7 @@ static int matroska_parse_block(Matroska
     }
 
     if (matroska->skip_to_keyframe) {
-        if (!is_keyframe || st != matroska->skip_to_stream)
+        if (!is_keyframe || timecode < matroska->skip_to_timecode)
             return res;
         matroska->skip_to_keyframe = 0;
     }
@@ -1706,7 +1706,7 @@ static int matroska_read_seek(AVFormatCo
 
     url_fseek(s->pb, st->index_entries[index].pos, SEEK_SET);
     matroska->skip_to_keyframe = !(flags & AVSEEK_FLAG_ANY);
-    matroska->skip_to_stream = st;
+    matroska->skip_to_timecode = st->index_entries[index].timestamp;
     matroska->done = 0;
     av_update_cur_dts(s, st, st->index_entries[index].timestamp);
     return 0;

Modified: trunk/tests/seek.regression.ref
==============================================================================
--- trunk/tests/seek.regression.ref	(original)
+++ trunk/tests/seek.regression.ref	Tue Sep  9 14:01:51 2008
@@ -2958,53 +2958,53 @@ ret: 0 st: 0 dts:0.000000 pts:0.000000 p
 ret: 0 st:-1 ts:-1.000000 flags:0
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st:-1 ts:1.894167 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301414 size:27927 flags:1
 ret: 0 st: 0 ts:0.788000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.800000 pts:0.800000 pos:259148 size:10844 flags:0
 ret: 0 st: 0 ts:-0.317000 flags:1
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st: 1 ts:2.577000 flags:0
 ret:-5
 ret: 0 st: 1 ts:1.471000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28603 size:208 flags:1
+ret: 0 st: 1 dts:0.993000 pts:0.993000 pos:329564 size:209 flags:1
 ret: 0 st:-1 ts:0.365002 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.400000 pts:0.400000 pos:128831 size:9787 flags:0
 ret: 0 st:-1 ts:-0.740831 flags:1
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st: 0 ts:2.153000 flags:0
 ret:-5
 ret: 0 st: 0 ts:1.048000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301414 size:27927 flags:1
 ret: 0 st: 1 ts:-0.058000 flags:0
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28603 size:208 flags:1
+ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st: 1 ts:2.836000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28603 size:208 flags:1
+ret: 0 st: 1 dts:0.993000 pts:0.993000 pos:329564 size:209 flags:1
 ret: 0 st:-1 ts:1.730004 flags:0
 ret:-5
 ret: 0 st:-1 ts:0.624171 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.600000 pts:0.600000 pos:200790 size:11166 flags:0
 ret: 0 st: 0 ts:-0.482000 flags:0
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st: 0 ts:2.413000 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301414 size:27927 flags:1
 ret: 0 st: 1 ts:1.307000 flags:0
 ret:-5
 ret: 0 st: 1 ts:0.201000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28603 size:208 flags:1
+ret: 0 st: 1 dts:0.183000 pts:0.183000 pos:72875 size:209 flags:1
 ret: 0 st:-1 ts:-0.904994 flags:0
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st:-1 ts:1.989173 flags:1
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.960000 pts:0.960000 pos:301414 size:27927 flags:1
 ret: 0 st: 0 ts:0.883000 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.920000 pts:0.920000 pos:290795 size:10395 flags:0
 ret: 0 st: 0 ts:-0.222000 flags:1
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ret: 0 st: 1 ts:2.672000 flags:0
 ret:-5
 ret: 0 st: 1 ts:1.566000 flags:1
-ret: 0 st: 1 dts:0.000000 pts:0.000000 pos:28603 size:208 flags:1
+ret: 0 st: 1 dts:0.993000 pts:0.993000 pos:329564 size:209 flags:1
 ret: 0 st:-1 ts:0.460008 flags:0
-ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
+ret: 0 st: 0 dts:0.480000 pts:0.480000 pos:149428 size:27442 flags:1
 ret: 0 st:-1 ts:-0.645825 flags:1
 ret: 0 st: 0 dts:0.000000 pts:0.000000 pos:478 size:28118 flags:1
 ----------------




More information about the ffmpeg-cvslog mailing list