[Mplayer-cvslog] CVS: main/libao2 pl_resample.c,1.3,1.4 ao_plugin.c,1.8,1.9 pl_delay.c,1.3,1.4
Anders Johansson
anders at mplayer.dev.hu
Sun Jan 27 11:41:52 CET 2002
Update of /cvsroot/mplayer/main/libao2
In directory mplayer:/var/tmp.root/cvs-serv4976
Modified Files:
pl_resample.c ao_plugin.c pl_delay.c
Log Message:
Fixed sig 11 caused by resampling plugin, some cosmetic changes and speed improvements
Index: pl_resample.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_resample.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pl_resample.c 15 Jan 2002 13:21:45 -0000 1.3
+++ pl_resample.c 27 Jan 2002 10:41:42 -0000 1.4
@@ -91,8 +91,8 @@
if(!pl_resample.data)
return CONTROL_ERROR;
ao_plugin_data.len = (int)((double)ao_plugin_data.len *
- ((double)pl_resample.up)/
- ((double)pl_resample.dn));
+ ((double)pl_resample.dn)/
+ ((double)pl_resample.up));
return CONTROL_OK;
}
return -1;
Index: ao_plugin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_plugin.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ao_plugin.c 23 Jan 2002 12:28:36 -0000 1.8
+++ ao_plugin.c 27 Jan 2002 10:41:43 -0000 1.9
@@ -159,7 +159,7 @@
if(!ok) return 0;
- // Allocate output buffer */
+ // Allocate output buffer
if(ao_plugin_local_data.buf)
free(ao_plugin_local_data.buf);
ao_plugin_local_data.buf=malloc(MAX_OUTBURST);
Index: pl_delay.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/pl_delay.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pl_delay.c 4 Dec 2001 12:20:17 -0000 1.3
+++ pl_delay.c 27 Jan 2002 10:41:43 -0000 1.4
@@ -101,18 +101,16 @@
// processes 'ao_plugin_data.len' bytes of 'data'
// called for every block of data
static int play(){
- int i=0;
- int j=0;
- int k=0;
// Copy end of prev block to begining of buffer
- for(i=0;i<ao_plugin_cfg.pl_delay_len;i++,j++)
- ((char*)pl_delay.data)[j]=((char*)pl_delay.delay)[i];
+ memcpy(pl_delay.data,pl_delay.delay,ao_plugin_cfg.pl_delay_len);
// Copy current block except end
- for(i=0;i<ao_plugin_data.len-ao_plugin_cfg.pl_delay_len;i++,j++,k++)
- ((char*)pl_delay.data)[j]=((char*)ao_plugin_data.data)[k];
+ memcpy(pl_delay.data+ao_plugin_cfg.pl_delay_len,
+ ao_plugin_data.data,
+ ao_plugin_data.len-ao_plugin_cfg.pl_delay_len);
// Save away end of current block for next call
- for(i=0;i<ao_plugin_cfg.pl_delay_len;i++,k++)
- ((char*)pl_delay.delay)[i]=((char*)ao_plugin_data.data)[k];
+ memcpy(pl_delay.delay,
+ ao_plugin_data.data+ao_plugin_data.len-ao_plugin_cfg.pl_delay_len,
+ ao_plugin_cfg.pl_delay_len);
// Set output data block
ao_plugin_data.data=pl_delay.data;
return 1;
More information about the MPlayer-cvslog
mailing list