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

Eric Lammerts eric at lammerts.org
Mon Jun 10 13:40:50 CEST 2002


On Mon, Jun 10, 2002 at 09:30:13AM +0800, Anders Johansson wrote:
> 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).

I changed my patch to take ao_plugin_local_data.bpm into account. I don't
think there would have been any problems with U8, but it's obviously needed
for S32.

It works fine with 1-channel U8 sound (tested using "-aop
list=volume:volume=100").

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	7 Jun 2002 00:30:32 -0000	1.19
+++ libao2/ao_plugin.c	10 Jun 2002 08:36:50 -0000
@@ -250,6 +250,8 @@
   // Limit length to avoid over flow in plugins
   int tmp = get_space();
   int ret_len =(tmp<len)?tmp:len;
+  // keep all channels of each sample together
+  ret_len -= ret_len % (ao_plugin_local_data.channels*ao_plugin_local_data.bpm/8);
   if(ret_len){
     // Filter data
     ao_plugin_data.len=ret_len;



More information about the MPlayer-dev-eng mailing list