From 9ccf62d4f698a78f8e09f9b9bcddca13c5fa406c Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Thu, 15 Aug 2024 11:25:40 -0400 Subject: [PATCH] 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. --- src/modules/module-rtp/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-rtp/audio.c b/src/modules/module-rtp/audio.c index 43b74e91d..56d70f7d3 100644 --- a/src/modules/module-rtp/audio.c +++ b/src/modules/module-rtp/audio.c @@ -337,7 +337,7 @@ static void rtp_audio_process_capture(void *data) expected_timestamp = timestamp; filled = 0; } 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); impl->have_sync = false; } else if (filled + wanted > (int32_t)(BUFFER_SIZE / stride)) {