# HG changeset patch # User michael # Date 1211550774 0 # Node ID f89173ea4c5e77bceb8871477ad46446ce0d9b74 # Parent 374e74567a4ed3682cf1c42099ea930172d8e09c Chapter demuxing support. (untested as I have no nuts with chapters) Isn't that much simpler than Matroska? diff -r 374e74567a4e -r f89173ea4c5e nutdec.c --- a/nutdec.c Fri May 23 13:14:11 2008 +0000 +++ b/nutdec.c Fri May 23 13:52:54 2008 +0000 @@ -393,6 +393,7 @@ int64_t value, end; char name[256], str_value[1024], type_str[256]; const char *type; + AVChapter *chapter= NULL; end= get_packetheader(nut, bc, 1, INFO_STARTCODE); end += url_ftell(bc); @@ -402,6 +403,13 @@ chapter_start= ff_get_v(bc); chapter_len = ff_get_v(bc); count = ff_get_v(bc); + + if(chapter_id && !stream_id_plus1){ + int64_t start= chapter_start / nut->time_base_count; + chapter= ff_new_chapter(s, chapter_id, start, start + chapter_len, NULL); + chapter->time_base= nut->time_base[chapter_start % nut->time_base_count]; + } + for(i=0; ititle= av_strdup(str_value); + } } if(skip_reserved(bc, end) || get_checksum(bc)){