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

Felix Buenemann atmosfear at users.sourceforge.net
Mon Jun 10 00:28:51 CEST 2002


On Sunday 09 June 2002 23:55, Eric Lammerts wrote:
> 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.
>
> Eric

Anders: ok to apply this? Or you wanna fix differently?

>
> 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	7 Jun 2002 00:30:32 -0000	1.19
> +++ 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

-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________



More information about the MPlayer-dev-eng mailing list