mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
echo-cancel: Skip processing till there's enough data
This makes sure that we only perform any processing (resync or actual cancellation) after the source provides enough data to actuall run the canceller.
This commit is contained in:
parent
cee6011572
commit
17011fcf70
1 changed files with 8 additions and 4 deletions
|
|
@ -665,15 +665,19 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
|
|||
while (pa_asyncmsgq_process_one(u->asyncmsgq) > 0)
|
||||
;
|
||||
|
||||
if (pa_atomic_cmpxchg (&u->request_resync, 1, 0)) {
|
||||
do_resync(u);
|
||||
}
|
||||
|
||||
pa_memblockq_push_align(u->source_memblockq, chunk);
|
||||
|
||||
rlen = pa_memblockq_get_length(u->source_memblockq);
|
||||
plen = pa_memblockq_get_length(u->sink_memblockq);
|
||||
|
||||
/* Let's not do anything else till we have enough data to process */
|
||||
if (rlen < u->blocksize)
|
||||
return;
|
||||
|
||||
if (pa_atomic_cmpxchg (&u->request_resync, 1, 0)) {
|
||||
do_resync(u);
|
||||
}
|
||||
|
||||
while (rlen >= u->blocksize) {
|
||||
pa_memchunk rchunk, pchunk;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue