[MPlayer-dev-eng] [PATCH] Simple 2:1 Audio Downsampling Plugin

Stephen Davies steve at daviesfam.org
Thu Dec 20 10:54:43 CET 2001


On Wed, 19 Dec 2001, Philip Chong wrote:

> Currently I've got one of those miserable sound cards which is limited
> to a 44.1 kHz maximum rate.  Needless to say, this makes a lot of stuff
> unplayable (at decent quality, anyways) under MPlayer.  Despite the
> assurances of sound.html in the docs, I was unable to figure out where
> the downsampling was happening in the SDL driver, or how even to turn
> this on.  So, I wrote an audio plugin to do simple 2:1 downsampling,
> and can now play 48 kHz audio (downsampled to 24 kHz, but still
> "reasonable" quality).
> 
> The audio plugin is turned on with the label "halfrate".  There is also
> a plugin flag "autohalfrate", which enables autodetection and disables
> the plugin if the original sample rate is less than or equal to 44.1
> kHz.  This means you can simply put "aop=list=halfrate:autohalfrate=1"
> in the config file, and be assured that downsampling will only happen
> when it is needed.

Hi Philip,

Thanks for the patch.

The code doesn't take care for the number of channels.  It will work OK
for mono, but the code mangles stereo - it copies two bytes, skips two
bytes.  So it will only copy left channel samples - to output left and
right alternately.  Even stranger things for >2 channels.  I think you
should review that.

I know that Anders is working on a general purpose resampler - but I think
he's away so it'll be new year before it'll be committed.

Steve






More information about the MPlayer-dev-eng mailing list