diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-06-16 15:54:29 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-06-16 15:54:29 +0000 |
commit | 3e081f4563dcbf706973d38ae7ec4e63dc221a56 (patch) | |
tree | 13f605826efa3983b707c6e2142ce8f4ba2f1c9a /libmpdemux | |
parent | 80141566b6cac7bce1955b7d9a4dda3f5b9faca1 (diff) |
Chapter support for lavf demuxer.
Patch by Anton Khirnov [wyskas gmail com]
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27090 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_lavf.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index f1975319f5..bc49ee0ab7 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -477,6 +477,13 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){ // 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; |