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

aurel subversion
Thu Jan 15 01:42:58 CET 2009


Author: aurel
Date: Thu Jan 15 01:42:57 2009
New Revision: 16612

Log:
matroskadec: ensure we only consider chapters which are properly ordered

Modified:
   trunk/libavformat/matroskadec.c

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	Thu Jan 15 00:53:31 2009	(r16611)
+++ trunk/libavformat/matroskadec.c	Thu Jan 15 01:42:57 2009	(r16612)
@@ -1076,6 +1076,7 @@ static int matroska_read_header(AVFormat
     EbmlList *index_list;
     MatroskaIndex *index;
     int index_scale = 1;
+    uint64_t max_start = 0;
     Ebml ebml = { 0 };
     AVStream *st;
     int i, j;
@@ -1365,10 +1366,13 @@ static int matroska_read_header(AVFormat
 
     chapters = chapters_list->elem;
     for (i=0; i<chapters_list->nb_elem; i++)
-        if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid)
+        if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid
+            && (max_start==0 || chapters[i].start > max_start)) {
             ff_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
                            chapters[i].start, chapters[i].end,
                            chapters[i].title);
+            max_start = chapters[i].start;
+        }
 
     index_list = &matroska->index;
     index = index_list->elem;




More information about the ffmpeg-cvslog mailing list