[MPlayer-dev-eng] [PATCH] Fix wrong runtime and average bitrate for VBR MP3.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri May 18 19:29:44 CEST 2012


On Fri, May 18, 2012 at 06:22:08PM +0200, Benoît Thébaudeau wrote:
> +int mp_get_mp3_header(unsigned char* hbuf,int* chans, int* srate, int* spf, int* mpa_layer, int* br, int* lsf){
> +    int stereo,ssize,_lsf,framesize,padding,bitrate_index,sampling_frequency, divisor;

I'd prefer that without all the renaming.
You can name the argument e.g. lsfp or even give it the full name
and the whole change to this file becomes a one-liner.

> -    if(srate) {
> +    if(srate)
>        *srate = freqs[sampling_frequency];
> -      if(spf) {
> -        if(layer == 1)
> -	  *spf = 384;
> -        else if(layer == 2)
> -	  *spf = 1152;
> -        else if(*srate < 32000)
> -          *spf = 576;
> -        else
> -	  *spf = 1152;
> -      }
> +    if(spf) {
> +      if(layer == 1)
> +	*spf = 384;
> +      else if(layer == 2)
> +	*spf = 1152;
> +      else if(*srate < 32000)
> +        *spf = 576;
> +      else
> +	*spf = 1152;

Well, that would now crash exactly in the case you are trying to fix.
I committed a fixed version of that part.


More information about the MPlayer-dev-eng mailing list