[MPlayer-dev-eng] [PATCH 1/2] playback_speed limits: new_srate

Robert Juliano juliano.1 at osu.edu
Sun Jun 3 19:11:49 CEST 2007


Reimar Dffinger <Reimar.Doeffinger <at> stud.uni-karlsruhe.de> writes:
> Are you sure about that? At least last time I checked at least one of
> the resamplers would not work with frequencies outside the 8kHz-192kHz
> range.

Yep.

With the patch, when I change the speed (default "[]{}BS" keys)
beyond these limits, resample or lavcresample (whichever I had
load with USE_LIBAVCODEC) keeps chugging along as expected.

And it's logical since new_srate hacks the input rate to the
filter chain, but the resample filter limits the output rate.
Here's the code where I found the limits.  I only see it
testing the output rate.

libaf/af_resample.c
  277   case AF_CONTROL_RESAMPLE_RATE | AF_CONTROL_SET: 
  278     // Reinit must be called after this function has been called
  279     
  280     // Sanity check
  281     if(((int*)arg)[0] < 8000 || ((int*)arg)[0] > 192000){
  282       af_msg(AF_MSG_ERROR,"[resample] The output sample frequency " 
  283              "must be between 8kHz and 192kHz. Current value is %i \n",
  284              ((int*)arg)[0]);
  285       return AF_ERROR;
  286     }
  287 
  288     af->data->rate=((int*)arg)[0]; 
  289     af_msg(AF_MSG_VERBOSE,"[resample] Changing sample rate "  
  290            "to %iHz\n",af->data->rate);
  291     return AF_OK;

That's says to me the limits are unnecessary.  Is that what it
is says to you?

Robert





More information about the MPlayer-dev-eng mailing list