[FFmpeg-cvslog] r23589 - trunk/libavformat/matroskadec.c

aurel subversion
Fri Jun 11 18:43:47 CEST 2010


Author: aurel
Date: Fri Jun 11 18:43:47 2010
New Revision: 23589

Log:
matroskadec: add support for live broadcast containing unknown size clusters
This interrupt parsing and goes one ebml level up when encountering
a cluster start inside an unknown sized element which is not supposed to
contain a cluster.
fix issue1991

Modified:
   trunk/libavformat/matroskadec.c

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	Fri Jun 11 18:36:51 2010	(r23588)
+++ trunk/libavformat/matroskadec.c	Fri Jun 11 18:43:47 2010	(r23589)
@@ -518,7 +518,7 @@ static int ebml_level_end(MatroskaDemuxC
 
     if (matroska->num_levels > 0) {
         MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1];
-        if (pos - level->start >= level->length) {
+        if (pos - level->start >= level->length || matroska->current_id) {
             matroska->num_levels--;
             return 1;
         }
@@ -716,6 +716,10 @@ static int ebml_parse_id(MatroskaDemuxCo
     for (i=0; syntax[i].id; i++)
         if (id == syntax[i].id)
             break;
+    if (!syntax[i].id && id == MATROSKA_ID_CLUSTER &&
+        matroska->num_levels > 0 &&
+        matroska->levels[matroska->num_levels-1].length == 0xffffffffffffffff)
+        return 0;  // we reached the end of an unknown size cluster
     if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32)
         av_log(matroska->ctx, AV_LOG_INFO, "Unknown entry 0x%X\n", id);
     return ebml_parse_elem(matroska, &syntax[i], data);



More information about the ffmpeg-cvslog mailing list