From 965b220206d9b83e0f40f9d6c905d95902ce19e4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 15 Feb 2023 11:08:08 +0100 Subject: [PATCH] module-rtp: clear ringbuffer in resync When we resync to the timestamp, clear the ringbuffer to avoid playing old stale samples. --- src/modules/module-rtp-source.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/module-rtp-source.c b/src/modules/module-rtp-source.c index 8fb082e86..59d36e6df 100644 --- a/src/modules/module-rtp-source.c +++ b/src/modules/module-rtp-source.c @@ -435,6 +435,7 @@ on_rtp_io(void *data, int fd, uint32_t mask) spa_dll_init(&sess->dll); spa_dll_set_bw(&sess->dll, SPA_DLL_BW_MIN, 128, sess->info.info.rate); + memset(sess->buffer, 0, BUFFER_SIZE); sess->have_sync = true; } else if (expected_timestamp != timestamp) { pw_log_debug("unexpected timestamp (%u != %u)",