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

Michael Niedermayer michaelni at gmx.at
Thu May 29 23:50:15 CEST 2008


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 ...

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20080529/c0acb38a/attachment.pgp>


More information about the MPlayer-dev-eng mailing list