summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2022-05-27 11:43:15 +0200
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2022-05-28 14:35:07 +0000
commitd146a8079b1fc69d71d42bb0e4a7288a48b5cd7a (patch)
tree7b993293b590c092f015934e81850cad29855f99
parent2af10cf39b1a12fb000672462ddaaf37f7d6e25e (diff)
downloadpulseaudio-d146a8079b1fc69d71d42bb0e4a7288a48b5cd7a.tar.gz
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: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/711>
-rw-r--r--src/modules/module-combine-sink.c2
1 files changed, 1 insertions, 1 deletions
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;