module-rtp: Increase write timestamp tolerance

We allow a quantum of jitter in the write timestamp. The previous value
of 32 seems to be empirically determined, using the actual quantum
allows us to reason about this better.
This commit is contained in:
Arun Raghavan 2024-08-15 11:25:40 -04:00 committed by Arun Raghavan
parent 3d34ec384b
commit 9ccf62d4f6

View file

@ -337,7 +337,7 @@ static void rtp_audio_process_capture(void *data)
expected_timestamp = timestamp; expected_timestamp = timestamp;
filled = 0; filled = 0;
} else { } else {
if (SPA_ABS((int32_t)expected_timestamp - (int32_t)timestamp) > 32) { if (SPA_ABS((int)expected_timestamp - (int)timestamp) > (int)quantum) {
pw_log_warn("expected %u != timestamp %u", expected_timestamp, timestamp); pw_log_warn("expected %u != timestamp %u", expected_timestamp, timestamp);
impl->have_sync = false; impl->have_sync = false;
} else if (filled + wanted > (int32_t)(BUFFER_SIZE / stride)) { } else if (filled + wanted > (int32_t)(BUFFER_SIZE / stride)) {