mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-21 13:08:08 +00:00
send output with all block of the same size
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@339 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
09ef279614
commit
91a4b2164a
1 changed files with 19 additions and 4 deletions
|
|
@ -104,12 +104,27 @@ static void speex_ec_process(MSFilter *f){
|
|||
int size=msgdsize(m);
|
||||
md = copyb(m);
|
||||
s->size_delay = s->size_delay + size;
|
||||
ms_queue_put(f->outputs[0],md);
|
||||
ms_bufferizer_put(&s->speak_delay,md);
|
||||
ms_bufferizer_put(&s->in[0],m);
|
||||
}
|
||||
|
||||
while((m=ms_queue_get(f->inputs[1]))!=NULL){
|
||||
ms_queue_put(f->outputs[1],m);
|
||||
/* make sure we always send block with same size */
|
||||
while (ms_bufferizer_get_avail(&s->speak_delay)>=nbytes)
|
||||
{
|
||||
om0=allocb(nbytes,0);
|
||||
ms_bufferizer_read(&s->speak_delay,(uint8_t*)om0->b_wptr,nbytes);
|
||||
om0->b_wptr+=nbytes;
|
||||
ms_queue_put(f->outputs[0],om0);
|
||||
}
|
||||
|
||||
/* make sure we always send block with same size */
|
||||
ms_bufferizer_put_from_queue(&s->in[1],f->inputs[1]);
|
||||
while (ms_bufferizer_get_avail(&s->in[1])>=nbytes)
|
||||
{
|
||||
om0=allocb(nbytes,0);
|
||||
ms_bufferizer_read(&s->in[1],(uint8_t*)om0->b_wptr,nbytes);
|
||||
om0->b_wptr+=nbytes;
|
||||
ms_queue_put(f->outputs[1],om0);
|
||||
}
|
||||
/* we are now equal and speaker is delayed */
|
||||
return;
|
||||
|
|
@ -163,7 +178,7 @@ static void speex_ec_process(MSFilter *f){
|
|||
count=0;
|
||||
}
|
||||
#endif
|
||||
freeb(om0);
|
||||
freeb(om0);
|
||||
}
|
||||
|
||||
if (ms_bufferizer_get_avail(&s->speak_delay)> 4*320*(s->samplerate/8000)) /* above 4*20ms -> useless */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue