From d146a8079b1fc69d71d42bb0e4a7288a48b5cd7a Mon Sep 17 00:00:00 2001 From: Georg Chini Date: Fri, 27 May 2022 11:43:15 +0200 Subject: combine-sink: Fix latency reports The combine sink used the current time and counter when calculating the latency if smoother_2 was enabled. This lead to wrong latency reports. This patch fixes the problem by using the snapshot time and counter instead. Part-of: --- src/modules/module-combine-sink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c index 7289aca73..9892bbbaf 100644 --- a/src/modules/module-combine-sink.c +++ b/src/modules/module-combine-sink.c @@ -1072,7 +1072,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse size_t latency; latency = pa_usec_to_bytes((pa_usec_t)offset, &u->sink->sample_spec); - pa_smoother_2_put(u->thread_info.smoother, pa_rtclock_now(), (int64_t)u->thread_info.counter - latency); + pa_smoother_2_put(u->thread_info.smoother, u->thread_info.snapshot_time, (int64_t)u->thread_info.snapshot_counter - latency); #else pa_usec_t x, y, latency = (pa_usec_t) offset; -- cgit v1.2.1