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

Anton Khirnov wyskas at gmail.com
Fri May 30 08:30:35 CEST 2008


On Thu, May 29, 2008 at 11:50 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Thu, May 29, 2008 at 10:35:44PM +0200, Anton Khirnov wrote:
>> On Thu, May 29, 2008 at 9:10 PM, Aurelien Jacobs <aurel at gnuage.org> wrote:
>> >
>> > It may be even better to factorize this inside demuxer_add_chapter().
>> >
>> > Aurel
>> >
>>
>> I thought demuxer_add_chapter will check for NULL itself. well
>> nevermind, it does now.
>>
>> Anton
>
>> Index: libmpdemux/demux_lavf.c
>> ===================================================================
>> --- libmpdemux/demux_lavf.c   (revision 26920)
>> +++ libmpdemux/demux_lavf.c   (working copy)
>> @@ -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 = c->start * 1000 * c->time_base.num / c->time_base.den;
>> +        uint64_t end = c->end * 1000 * c->time_base.num / c->time_base.den;
>
> This should use av_rescale_q() so it wont overflow.
> Also it could be vertically aligned for beauty:
>        uint64_t start = c->start * 1000 * c->time_base.num / c->time_base.den;
>        uint64_t end   = c->end   * 1000 * c->time_base.num / c->time_base.den;
>
> and except that iam fine with the patch if everyone else is ...
>

done

Anton
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demuxer.diff
Type: text/x-diff
Size: 519 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080530/1ac762a2/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lavf_chapters.diff
Type: text/x-diff
Size: 769 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080530/1ac762a2/attachment-0001.diff>


More information about the MPlayer-dev-eng mailing list