[FFmpeg-devel] [PATCH] mp3enc: Fix Xing tag identification string for CBR files

Michael Niedermayer michaelni at gmx.at
Mon May 7 12:51:37 CEST 2012


On Mon, May 07, 2012 at 11:55:05AM +0200, Tobias Rapp wrote:
> Michael Niedermayer wrote:
> > > diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
> > > index 29c0780..cb61e37 100644
> > > --- a/libavformat/mp3enc.c
> > > +++ b/libavformat/mp3enc.c
> > > @@ -180,7 +180,11 @@ static int mp3_write_xing(AVFormatContext *s)
> > >  
> > >      avio_wb32(s->pb, header);
> > >      ffio_fill(s->pb, 0, xing_offset);
> > > -    avio_wb32(s->pb, MKBETAG('X', 'i', 'n', 'g'));
> > > +    /* use "Xing" identification string for VBR files and "Info" for CBR */
> > > +    if (codec->flags & CODEC_FLAG_QSCALE) 
> > 
> > This is problematic as this flag will only be set reliable on encoding
> > but not on transcoding (-acodec copy)
> > 
> > better would be to update the tag in mp3_fix_xing() at the end
> > after storing all packets if they all "match"/dont "match" in size
> 
> Good catch. Have reworked the patch to look at all the packet headers and
> decide for CBR/VBR.
> 
> Regards,
> Tobias

>  mp3enc.c |   25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 3052b9f2c9764d316d28baaf79f94bc5b542b0b7  0001-mp3enc-Fix-Xing-tag-identification-string-for-CBR-f.patch
> From 27c91e266f5bf4b6ccc1f16581227ecb5d7f7d4e Mon Sep 17 00:00:00 2001
> From: Tobias Rapp <t.rapp at noa-audio.com>
> Date: Mon, 7 May 2012 11:41:05 +0200
> Subject: [PATCH] mp3enc: Fix Xing tag identification string for CBR files
> 
> Fixes the Xing tag identification string to be "Info" for MP3 files with
> constant bitrate. The previous "Xing" caused some decoders to recognize the
> file as VBR.

applied

thanks

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20120507/d992fe13/attachment.asc>


More information about the ffmpeg-devel mailing list