[FFmpeg-devel] [PATCH] Print chapter info in dump_format().

Anton Khirnov wyskas
Sun Feb 28 15:32:59 CET 2010


On Sun, Feb 28, 2010 at 01:44:07PM +0100, Michael Niedermayer wrote:
> On Sun, Feb 28, 2010 at 09:40:03AM +0100, Anton Khirnov wrote:
> > ---
> >  libavformat/utils.c |   14 ++++++++++++++
> >  1 files changed, 14 insertions(+), 0 deletions(-)
> > 
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index 1fbceea..a79f789 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -3009,6 +3009,20 @@ void dump_format(AVFormatContext *ic,
> >          }
> >          av_log(NULL, AV_LOG_INFO, "\n");
> >      }
> > +    for (i = 0; i < ic->nb_chapters; i++) {
> > +        AVChapter *ch = ic->chapters[i];
> > +        int secs, us;
> > +
> > +        av_log(NULL, AV_LOG_INFO, "    Chapter #%d.%d: ", index, i);
> 
> > +        secs = av_rescale_q(ch->start, ch->time_base, (AVRational){1, 1});
> > +        us   = av_rescale_q(ch->start, ch->time_base, AV_TIME_BASE_Q) % AV_TIME_BASE;
> > +        av_log(NULL, AV_LOG_INFO, "start %d.%06d, ", secs, us);
> 
> i think something along the line of
> av_log(NULL, AV_LOG_INFO, "start %f", ch->start / av_q2d(ch->time_base)
> might be cleaner but maybe theressome rounding or bitexact display isue
> with it i dunno
> 
ok, changed

Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Print-chapter-info-in-dump_format.patch
Type: text/x-diff
Size: 1055 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100228/52b3c7e6/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100228/52b3c7e6/attachment.pgp>



More information about the ffmpeg-devel mailing list