[FFmpeg-cvslog] r23185 - in branches/0.6: . libavformat/asfdec.c

siretart subversion
Wed May 19 13:44:45 CEST 2010


Author: siretart
Date: Wed May 19 13:44:45 2010
New Revision: 23185

Log:
Favor chunk size over hitting the correct position after reading the chunk size in asf.
Fixes issue1923


backport r23040 by michael

Modified:
   branches/0.6/   (props changed)
   branches/0.6/libavformat/asfdec.c

Modified: branches/0.6/libavformat/asfdec.c
==============================================================================
--- branches/0.6/libavformat/asfdec.c	Wed May 19 13:39:02 2010	(r23184)
+++ branches/0.6/libavformat/asfdec.c	Wed May 19 13:44:45 2010	(r23185)
@@ -204,9 +204,10 @@ static int asf_read_header(AVFormatConte
     get_byte(pb);
     memset(&asf->asfid2avid, -1, sizeof(asf->asfid2avid));
     for(;;) {
+        uint64_t gpos= url_ftell(pb);
         get_guid(pb, &g);
         gsize = get_le64(pb);
-        dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24);
+        dprintf(s, "%08"PRIx64": ", gpos);
         print_guid(&g);
         dprintf(s, "  size=0x%"PRIx64"\n", gsize);
         if (!guidcmp(&g, &ff_asf_data_header)) {
@@ -584,8 +585,10 @@ static int asf_read_header(AVFormatConte
                     av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n");
                 }
             }
-            url_fseek(pb, gsize - 24, SEEK_CUR);
         }
+        if(url_ftell(pb) != gpos + gsize)
+            av_log(s, AV_LOG_DEBUG, "gpos mismatch our pos=%"PRIu64", end=%"PRIu64"\n", url_ftell(pb)-gpos, gsize);
+        url_fseek(pb, gpos + gsize, SEEK_SET);
     }
     get_guid(pb, &g);
     get_le64(pb);



More information about the ffmpeg-cvslog mailing list