diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-05-23 13:02:27 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-05-23 13:02:27 +0000 |
commit | 7a2a3e8e401d8ac6a8306e67cc164fc70b006155 (patch) | |
tree | f86ca77e5cb205b4ba524332cb2d950a78610445 /libavformat/matroskadec.c | |
parent | 8931e7b48a96d8034dd01a5000433735c522d92a (diff) |
Add id to AVChapter, untested (where do i find matroska files with chapters?).
Originally committed as revision 13255 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 1fdf39910f..7f9352e46c 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -2160,6 +2160,7 @@ matroska_parse_chapters(AVFormatContext *s) switch (id) { case MATROSKA_ID_EDITIONENTRY: { uint64_t end = AV_NOPTS_VALUE, start = AV_NOPTS_VALUE; + int64_t uid= -1; char* title = NULL; /* if there is more than one chapter edition we take only the first one */ @@ -2235,9 +2236,11 @@ matroska_parse_chapters(AVFormatContext *s) } break; + case MATROSKA_ID_CHAPTERUID: + res = ebml_read_uint(matroska, &id, &uid); + break; default: av_log(s, AV_LOG_INFO, "Ignoring unknown Chapter atom ID 0x%x\n", id); - case MATROSKA_ID_CHAPTERUID: case MATROSKA_ID_CHAPTERFLAGHIDDEN: case EBML_ID_VOID: res = ebml_read_skip(matroska); @@ -2250,11 +2253,11 @@ matroska_parse_chapters(AVFormatContext *s) } } - if (start != AV_NOPTS_VALUE) { + if (start != AV_NOPTS_VALUE && uid != -1) { start = start * AV_TIME_BASE / 1000000000; if (end != AV_NOPTS_VALUE) end = end * AV_TIME_BASE / 1000000000; - res = ff_new_chapter(s, start, end, title); + res = ff_new_chapter(s, uid, start, end, title); } av_free(title); break; |