[MPlayer-dev-eng] vbr mp3 runtime

Ingo Brückl ib at wupperonline.de
Sun Sep 25 19:00:55 CEST 2011

Reimar Döffinger wrote on Sun, 25 Sep 2011 15:22:01 +0200:

> Since your code will break completely if HDR_SIZE is anything but 4,
> using it serves at best as obfuscation.
> Even more since stream_read_dword in all cases except maybe this first
> should result in much more readable code.

2nd attempt.

> And have you tested all cases?

I did so with numerous vbr mp3 files, both Xing/Info and VBRI, and I used

> Because the FFmpeg code until recently read things from the wrong place for
> one of the headers.

Do you refer to the bug I fixed in FFmpeg while developing this patch?

Everything is read from the right place.

>> @@ -382,6 +440,8 @@
>>       demux_info_add(demuxer,"Genre",genres[g]);
>>        }
>>      }
>> +    if (duration) sh_audio->wf->nAvgBytesPerSec = demuxer->movi_end / duration;
>> +    sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec;

> Why not just move this to where sh_audio->i_bps is already assigned
> currently?

Because demuxer->movi_end is needed which is set correctly only after the
tags evaluating code.

> Also I am not sure demuxer->movi_end is necessarily set/!= 0.

Well, if so, it's already with the current code. demux_audio.patch will
ensure it is set, but that is not directly related to the vbr patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp3.vbr.patch
Type: text/x-diff
Size: 3437 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110925/0e5ccd93/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demux_audio.patch
Type: text/x-diff
Size: 800 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110925/0e5ccd93/attachment-0001.bin>

More information about the MPlayer-dev-eng mailing list