[FFmpeg-devel] [PATCH] use Xing tag to read duration from mp3 files

Michael Niedermayer michaelni
Tue Oct 23 14:24:38 CEST 2007


Hi

On Tue, Oct 23, 2007 at 01:50:45PM +0200, Andreas ?man wrote:
> 'lo
>
> Benjamin Larsson wrote:
>> Hi,
>> Either 'Xing' or 'Info' from the page, have Info been deprecated or 
>> something ?
>
> Right, i missed that. I've added and tested it.
>
>> Can't you add support for VBRI also ?
>
> Sure, but perhaps in a separate patch.
>
>> And don't forget to close the roundup issue.
>
> I will

[...]
> +    if(v & 0x1) {
> +        frames = get_be32(&s->pb);   /* Total number of frames in file */
> +        spf    = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
> +
> +        st->duration = av_rescale_q(1000000LL * frames * spf / c.sample_rate,
> +                                    AV_TIME_BASE_Q, st->time_base);

this is wrong it assumes 1000000 == 1/AV_TIME_BASE_Q

av_rescale_q(frames, (AVRational){spf, c.sample_rate}, st->time_base);

except that, patch ok


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

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20071023/51e61356/attachment.pgp>



More information about the ffmpeg-devel mailing list