module-pipe: resync when ringbuffer too full

When the ringbuffer has too much data, do a resync or else we would just
have a huge delay and would try to resample to get back to the target
fill level.
This commit is contained in:
Wim Taymans 2024-02-01 15:57:45 +01:00
parent 0bc7f3f48c
commit d7e48f3042

View file

@ -416,6 +416,10 @@ static void capture_stream_process(void *data)
}
impl->have_sync = false;
}
if (avail > (int32_t)(impl->target_buffer * 3)) {
pw_log_warn("resync %d > %u", avail, (int32_t)(impl->target_buffer * 3));
impl->have_sync = false;
}
if (avail > (int32_t)RINGBUFFER_SIZE) {
index += avail - impl->target_buffer;
avail = impl->target_buffer;