[MPlayer-dev-eng] [PATCH] fix for -srate bug

Giacomo Comes comes at naic.edu
Mon Oct 18 16:25:56 CEST 2004


On Sun, Oct 17, 2004 at 11:31:53AM -0400, D Richard Felker III wrote:
> On Sun, Oct 17, 2004 at 05:06:34PM +0200, Attila Kinali wrote:
> > On Sun, 1 Aug 2004 23:53:58 +0900
> > Attila Kinali <attila at kinali.ch> wrote:
> > 
> > > On Fri, Jul 16, 2004 at 02:55:26PM -0400, Giacomo Comes wrote:
> > > > Some time ago I reported a bug with the -srate option.
> > > > I have been digging around a little bit and I found the solution.
> > > > This patch solve the problem.
> > > > 
> > > > --- libaf/af.c.ori	2004-07-15 17:42:07.000000000 -0400
> > > > +++ libaf/af.c	2004-07-15 17:42:28.000000000 -0400
> > > > @@ -382,12 +382,6 @@
> > > >        if(!af || (AF_OK != af->control(af,AF_CONTROL_RESAMPLE_RATE,
> > > >  				      &(s->output.rate))))
> > > >  	return -1;
> > > > -      // Use lin int if the user wants fast
> > > > -      if ((AF_INIT_TYPE_MASK & s->cfg.force) == AF_INIT_FAST) {
> > > > -        char args[32];
> > > > -	sprintf(args, "%d:0:0", s->output.rate);
> > > > -	af->control(af, AF_CONTROL_COMMAND_LINE, args);
> > > > -      }
> > > >        if(AF_OK != af_reinit(s,af))
> > > >        	return -1;
> > > >      }	
> > > > 
> > > > This code went in 2004-01-27 and it's what cause the problem with -srate.
> > > > Can somebody explain if it can be safely removed or it has to stay but it needs
> > > > some modification?
> > > 
> > > Good question. Is there somebody out there who cares about af ?
> > 
> > Anyone out there ?
> 
> the original code is correct as far as i can tell. if someone claims
> it's a bug they need to explain why, not just send a patch.
> 
> rich

I did explain why and I reported the bug more than one time.
This is the first time that I see a comment on it except for the request
of Attila.

Here is the explanation of the bug:

Listen with mplayer 1.0pre4/5 the first 10/15 seconds of this video:
mplayer -nocache http://www.telenorba.dyrecta.com/video/tnnews56/18010.asf
the audio is 8000 Hz.
Now do the same with -srate:
mplayer -nocache http://www.telenorba.dyrecta.com/video/tnnews56/18010.asf -srate 44100

Do you hear any difference? I do if I do not apply the patch I submitted.
The resampling introduce a distorsion in the audio.

I have seen the distorsion expecially with 8000 Hz samples when I resample at 44100 Hz.
But id doesn't appear with ALL the 8000 Hz samples. 
I have seen it also with audio samples with higher 
sample rate, but in that case it's more difficult to hear the distortion.

This bug has been confirmed at least by one other user.

if you need more details please ask me.

Giacomo




More information about the MPlayer-dev-eng mailing list