[MPlayer-dev-eng] New audio filter layer finished
Anders Johansson
ajh at watri.uwa.edu.au
Thu Oct 3 13:41:17 CEST 2002
Hi,
It was a porting bug thanks for fixing.
//Anders
> Hi,
>
> > > now, the problems.
> > > i've tried to play the matrix 1 trailer .vob (2.0ch 48khz ac3) wiht -srate
> > > 44100 and i got strange noise, clicks sometimes.
> >
> > I get these as well but only when using your version. I don't have
> > time to look at it now. I'll try to look at the problem tomorrow.
>
> ok i've found the bug, in your code, af_resample.c:downsample() :
>
> i = s->i; wi = s->wi; xi = s->xi;
> while(in < end){
> ADDQUE(xi,x,in);
> in+=nch;
> if(!--i){
> ^^^^^^
> the bug is here! s->i is initialized to 0 by memset() at allocation.
> so, at first run it will --i, resulting 65535 (i was uint_16) and it took
> some time while it reached zero. so, it skipped 65535 samples.
> now it drops 4Gigs of audio samples, as i was changed to uint_32 :)
>
> i've changed that if to if((--i)<=0) and now works fine even with my patch.
> is it ok? i'm not sure, maybe if(!i--) is better. dunno.
>
>
> A'rpi / Astral & ESP-team
>
More information about the MPlayer-dev-eng
mailing list