[MPlayer-dev-eng] [PATCH] prevent breaking up of samples between audio plugin calls

Anders Johansson ajh at atri.curtin.edu.au
Mon Jun 10 03:30:13 CEST 2002


Hi Erik,

> 
> Hi,
> When trying out the resample plugin (with 6-channel output), I noticed that
> the channels move around everytime I resume from pause (for example, the
> center channel hops between left front, center and left rear).
> 
> This is because at that moment, the resample plugin gets a
> ao_plugin_data.len of 65536. This is not a multiple of 6 * 2, so one sample
> gets broken up between plugin calls. The resample plugin is not designed to
> handle that.
> 
> Patch below makes sure that all audio plugins always get whole samples.
> 

Thank you for the patch. Could you please test this on U8 data before
we apply (volume plugin supports U8). Perhaps you will get clicks in
the sound (I am not sure).

Thanks,
//Anders

> Eric
> 
> Index: libao2/ao_plugin.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libao2/ao_plugin.c,v
> retrieving revision 1.19
> diff -u -r1.19 ao_plugin.c
> +++ libao2/ao_plugin.c	9 Jun 2002 22:00:50 -0000
> @@ -250,6 +250,7 @@
>    // Limit length to avoid over flow in plugins
>    int tmp = get_space();
>    int ret_len =(tmp<len)?tmp:len;
> +  ret_len -= ret_len % (ao_plugin_local_data.channels * 2);
>    if(ret_len){
>      // Filter data
>      ao_plugin_data.len=ret_len;
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list