[FFmpeg-devel] [PATCH] au: add duration info

Michael Niedermayer michaelni at gmx.at
Wed Jul 13 22:33:21 CEST 2011


On Wed, Jul 13, 2011 at 12:23:35PM +0200, ami_stuff wrote:
[...]
> @@ -159,6 +164,10 @@ static int au_read_header(AVFormatContext *s,
>      st->codec->codec_id = codec;
>      st->codec->channels = channels;
>      st->codec->sample_rate = rate;
> +
> +    if (data_size)
> +        st->duration = (data_size<<3) / (st->codec->channels * (uint64_t)av_get_bits_per_sample(st->codec->codec_id));
                                     ^^^
can overflow
otherwise LGTM

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110713/7bafdb87/attachment.asc>


More information about the ffmpeg-devel mailing list