various places: Include resampler delay to latency reports and calculations

The resampler delay was not taken into account in all necessary places.
This patch adds it where required.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/708>
This commit is contained in:
Georg Chini 2022-05-26 20:24:08 +02:00 committed by PulseAudio Marge Bot
parent 3271020747
commit 2af10cf39b
9 changed files with 31 additions and 0 deletions

View file

@ -771,6 +771,8 @@ static int sink_input_process_msg(pa_msgobject *obj, int code, void *data, int64
/* Add content of memblockq's to sink latency */
o->latency_snapshot.sink_latency = pa_sink_get_latency_within_thread(o->sink, true) +
pa_bytes_to_usec(length, &o->sink->sample_spec);
/* Add resampler latency */
o->latency_snapshot.sink_latency += pa_resampler_get_delay_usec(o->sink_input->thread_info.resampler);
o->latency_snapshot.timestamp = pa_rtclock_now();