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

Michael Niedermayer michaelni
Sun Feb 28 13:44:07 CET 2010


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

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- 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/ffmpeg-devel/attachments/20100228/3ce6f9b0/attachment.pgp>



More information about the ffmpeg-devel mailing list