changeset 27058:2f4343465df1

Chapter support for lavf demuxer. Patch by Anton Khirnov [wyskas gmail com]
author reimar
date Mon, 16 Jun 2008 15:54:29 +0000
parents 42332b47d6aa
children 3771c9d8daf6
files libmpdemux/demux_lavf.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_lavf.c	Mon Jun 16 15:53:28 2008 +0000
+++ b/libmpdemux/demux_lavf.c	Mon Jun 16 15:54:29 2008 +0000
@@ -477,6 +477,13 @@
 //    if(avfc->track       ) demux_info_add(demuxer, "track"    , avfc->track    );
     if(avfc->genre    [0]) demux_info_add(demuxer, "genre"    , avfc->genre    );
 
+    for(i=0; i < avfc->nb_chapters; i++) {
+        AVChapter *c = avfc->chapters[i];
+        uint64_t start = av_rescale_q(c->start, c->time_base, (AVRational){1,1000});
+        uint64_t end   = av_rescale_q(c->end, c->time_base, (AVRational){1,1000});
+        demuxer_add_chapter(demuxer, c->title, start, end);
+    }
+
     if(avfc->nb_programs) {
         int p, start=0, found=0;