Fixed sig 11 caused by buffer full in ao driver

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4376 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
anders 2002-01-27 10:59:03 +00:00
parent c045148761
commit f7737ca1e0
1 changed files with 20 additions and 16 deletions

View File

@ -217,11 +217,15 @@ static int play(void* data,int len,int flags){
// Limit length to avoid over flow in plugins
int tmp = driver()->get_space();
int ret_len =(tmp<len)?tmp:len;
if(ret_len){
// Filter data
ao_plugin_data.len=ret_len;
ao_plugin_data.data=data;
while(plugin(i))
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);
@ -232,7 +236,7 @@ static int play(void* data,int len,int flags){
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;
}