[FFmpeg-cvslog] r19197 - trunk/libavformat/dv.c

bcoudurier subversion
Mon Jun 15 03:42:00 CEST 2009


Author: bcoudurier
Date: Mon Jun 15 03:41:59 2009
New Revision: 19197

Log:
fix probing and demuxing of pond.dv, issue #887

Modified:
   trunk/libavformat/dv.c

Modified: trunk/libavformat/dv.c
==============================================================================
--- trunk/libavformat/dv.c	Mon Jun 15 01:55:25 2009	(r19196)
+++ trunk/libavformat/dv.c	Mon Jun 15 03:41:59 2009	(r19197)
@@ -400,7 +400,7 @@ typedef struct RawDVContext {
 static int dv_read_header(AVFormatContext *s,
                           AVFormatParameters *ap)
 {
-    unsigned state;
+    unsigned state, marker_pos = 0;
     RawDVContext *c = s->priv_data;
 
     c->dv_demux = dv_init_demux(s);
@@ -413,6 +413,13 @@ static int dv_read_header(AVFormatContex
             av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
             return -1;
         }
+        if (state == 0x003f0700 || state == 0xff3f0700)
+            marker_pos = url_ftell(s->pb);
+        if (state == 0xff3f0701 && url_ftell(s->pb) - marker_pos == 80) {
+            url_fseek(s->pb, -163, SEEK_CUR);
+            state = get_be32(s->pb);
+            break;
+        }
         state = (state << 8) | get_byte(s->pb);
     }
     AV_WB32(c->buf, state);
@@ -476,7 +483,7 @@ static int dv_read_close(AVFormatContext
 
 static int dv_probe(AVProbeData *p)
 {
-    unsigned state;
+    unsigned state, marker_pos = 0;
     int i;
 
     if (p->buf_size < 5)
@@ -486,6 +493,10 @@ static int dv_probe(AVProbeData *p)
     for (i = 4; i < p->buf_size; i++) {
         if ((state & 0xffffff7f) == 0x1f07003f)
             return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
+        if (state == 0x003f0700 || state == 0xff3f0700)
+            marker_pos = i;
+        if (state == 0xff3f0701 && i - marker_pos == 80)
+            return AVPROBE_SCORE_MAX/4;
         state = (state << 8) | p->buf[i];
     }
 



More information about the ffmpeg-cvslog mailing list