From d206b06c708c8d941f65597e5cf9929b7b44a81f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 1 Mar 2026 12:49:24 +0100 Subject: [PATCH] sendspin: cleanup receive sync and logging don't check the same thing twice. Make sure values are set before we log them. --- src/modules/module-sendspin-recv.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/module-sendspin-recv.c b/src/modules/module-sendspin-recv.c index 526a56912..fe6525767 100644 --- a/src/modules/module-sendspin-recv.c +++ b/src/modules/module-sendspin-recv.c @@ -267,7 +267,7 @@ static void on_capture_stream_process(void *d) avail = spa_ringbuffer_get_read_index(&client->ring, &index); - if (client->timeout_count > 4 && client->timeout_count > 4) { + if (client->timeout_count > 4) { pw_stream_get_time_n(client->stream, &ts, sizeof(ts)); /* index to server time */ @@ -298,6 +298,12 @@ static void on_capture_stream_process(void *d) avail = 0; } } + + corr = spa_dll_update(&client->dll, SPA_CLAMPD(err, -1000, 1000)); + + pw_stream_set_rate(client->stream, 1.0 / corr); + + pw_log_trace("%u %f %f %f %f", index, current_time, target, err, corr); } else { avail = 0; } @@ -313,12 +319,6 @@ static void on_capture_stream_process(void *d) if (avail > 0) { n_bytes = SPA_MIN(n_bytes, (uint32_t)avail); - corr = spa_dll_update(&client->dll, SPA_CLAMPD(err, -1000, 1000)); - - pw_log_trace("%u %f %f %f %f", index, current_time, target, err, corr); - - pw_stream_set_rate(client->stream, 1.0 / corr); - spa_ringbuffer_read_data(&client->ring, client->buffer, client->buffer_size, index % client->buffer_size,