Mercurial > libavformat.hg
changeset 4218:4162b8362ed6 libavformat
matroskadec: ensure we only consider chapters which are properly ordered
author | aurel |
---|---|
date | Thu, 15 Jan 2009 00:42:57 +0000 |
parents | 2f3780431c5a |
children | 3bfd8604f480 |
files | matroskadec.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/matroskadec.c Wed Jan 14 23:53:31 2009 +0000 +++ b/matroskadec.c Thu Jan 15 00:42:57 2009 +0000 @@ -1076,6 +1076,7 @@ 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 @@ 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;