[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Linphone-developers] Fix for ALSA/dmix garbled output
From: |
Lilith Verlorenes |
Subject: |
[Linphone-developers] Fix for ALSA/dmix garbled output |
Date: |
Sun, 29 Jan 2006 13:49:28 +1300 |
User-agent: |
KMail/1.7 |
ok, i've tracked down the problem(s):
here's a new version of alsa_card_write in mediastreamer*/alsacard.c:
===========================
int alsa_card_write(AlsaCard *obj,char *buf,int size)
{
int err;
gint bsize=SND_CARD(obj)->bsize;
g_return_val_if_fail(obj->write_handle!=NULL,-1);
if (size!=bsize || obj->writepos!=0){
gint canwrite;
gint totalwrite=0;
while(1){
canwrite=MIN(bsize-obj->writepos,size);
if (canwrite==0)
break;
memcpy(&obj->writebuf[obj->writepos],buf,canwrite);
obj->writepos+=canwrite;
if (obj->writepos>=bsize){
err=__alsa_card_write(obj,obj->writebuf,bsize);
obj->writepos=0;
}
size-=canwrite;
buf+=canwrite;
totalwrite+=canwrite;
}
return totalwrite;
}else{
return __alsa_card_write(obj,buf,bsize);
}
}
===========================
changes:
1) tighter checks on when it is possible to pass a complete buffer through
without using obj->writebuf
2) call __alsa_card_write as many times as needed rather than only once.
linphone now works very well on my system, thank you!
lilith
- [Linphone-developers] Fix for ALSA/dmix garbled output,
Lilith Verlorenes <=