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

@ -105,6 +105,9 @@ static int sink_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t of
/* Add the latency internal to our sink input on top */
pa_bytes_to_usec(pa_memblockq_get_length(u->sink_input->thread_info.render_memblockq), &u->sink_input->sink->sample_spec);
/* Add resampler latency */
*((int64_t*) data) += pa_resampler_get_delay_usec(u->sink_input->thread_info.resampler);
return 0;
}