[MPlayer-dev-eng] [PATCH]chapters in lavf demuxer

Anton Khirnov wyskas at gmail.com
Thu May 29 18:47:14 CEST 2008


On Thu, May 29, 2008 at 6:26 PM, Reimar Döffinger
<Reimar.Doeffinger at stud.uni-karlsruhe.de> wrote:
> On Thu, May 29, 2008 at 05:02:39PM +0200, Anton Khirnov wrote:
>> Hi,
>> this patch adds support for chapters to lavf demuxer.
>>
>> Anton
>
>> Index: libmpdemux/demux_lavf.c
>> ===================================================================
>> --- libmpdemux/demux_lavf.c   (revision 26920)
>> +++ libmpdemux/demux_lavf.c   (working copy)
>> @@ -477,6 +477,15 @@
>>  //    if(avfc->track       ) demux_info_add(demuxer, "track"    , avfc->track    );
>>      if(avfc->genre    [0]) demux_info_add(demuxer, "genre"    , avfc->genre    );
>>
>> +    if(avfc->nb_chapters) {
>> +        uint64_t start, end;
>> +        for(i=0; i < avfc->nb_chapters; i++) {
>> +            start = avfc->chapters[i]->start * 1000 * avfc->chapters[i]->time_base.num / avfc->chapters[i]->time_base.den;
>> +            end = avfc->chapters[i]->end * 1000 * avfc->chapters[i]->time_base.num / avfc->chapters[i]->time_base.den;
>> +            demuxer_add_chapter(demuxer, avfc->chapters[i]->title, start, end);
>> +        }
>> +    }
>
> The "if" is not necessary and the declaration and assignment of start
> and end can be merged.

ok

Anton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lavf_chapters.diff
Type: text/x-patch
Size: 826 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080529/f0b38173/attachment.bin>


More information about the MPlayer-dev-eng mailing list