[Mplayer-cvslog] CVS: main/libao2 ao_plugin.c,1.9,1.10
Anders Johansson
anders at mplayer.dev.hu
Sun Jan 27 11:59:06 CET 2002
Update of /cvsroot/mplayer/main/libao2
In directory mplayer:/var/tmp.root/cvs-serv11944
Modified Files:
ao_plugin.c
Log Message:
Fixed sig 11 caused by buffer full in ao driver
Index: ao_plugin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libao2/ao_plugin.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ao_plugin.c 27 Jan 2002 10:41:43 -0000 1.9
+++ ao_plugin.c 27 Jan 2002 10:59:03 -0000 1.10
@@ -217,22 +217,26 @@
// Limit length to avoid over flow in plugins
int tmp = driver()->get_space();
int ret_len =(tmp<len)?tmp:len;
- // Filter data
- ao_plugin_data.len=ret_len;
- ao_plugin_data.data=data;
- while(plugin(i))
- plugin(i++)->play();
- // Copy data to output buffer
- memcpy(ao_plugin_local_data.buf+ao_plugin_local_data.len,
- ao_plugin_data.data,ao_plugin_data.len);
- // Send data to output
- l=driver()->play(ao_plugin_local_data.buf,
- ao_plugin_data.len+ao_plugin_local_data.len,flags);
- // Save away unsent data
- ao_plugin_local_data.len=ao_plugin_data.len+ao_plugin_local_data.len-l;
- memcpy(ao_plugin_local_data.buf,ao_plugin_local_data.buf+l,
- ao_plugin_local_data.len);
-
+ if(ret_len){
+ // Filter data
+ ao_plugin_data.len=ret_len;
+ ao_plugin_data.data=data;
+ while(plugin(i)){
+ printf("%i \n",ao_plugin_data.len);
+ plugin(i++)->play();
+ printf("%i \n",ao_plugin_data.len);
+ }
+ // Copy data to output buffer
+ memcpy(ao_plugin_local_data.buf+ao_plugin_local_data.len,
+ ao_plugin_data.data,ao_plugin_data.len);
+ // Send data to output
+ l=driver()->play(ao_plugin_local_data.buf,
+ ao_plugin_data.len+ao_plugin_local_data.len,flags);
+ // Save away unsent data
+ ao_plugin_local_data.len=ao_plugin_data.len+ao_plugin_local_data.len-l;
+ memcpy(ao_plugin_local_data.buf,ao_plugin_local_data.buf+l,
+ ao_plugin_local_data.len);
+ }
return ret_len;
}
More information about the MPlayer-cvslog
mailing list