mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
virtual sources: Include resampler delay in latency reports
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/120>
This commit is contained in:
parent
d55fde2fed
commit
129a59a2f0
3 changed files with 9 additions and 0 deletions
|
|
@ -422,6 +422,9 @@ static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t
|
|||
/* and the buffering we do on the source */
|
||||
pa_bytes_to_usec(u->source_output_blocksize, &u->source_output->source->sample_spec);
|
||||
|
||||
/* Add resampler delay */
|
||||
*((int64_t*) data) += pa_resampler_get_delay_usec(u->source_output->thread_info.resampler);
|
||||
|
||||
return 0;
|
||||
|
||||
case PA_SOURCE_MESSAGE_SET_VOLUME_SYNCED:
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t
|
|||
/* Add the latency internal to our source output on top */
|
||||
pa_bytes_to_usec(pa_memblockq_get_length(u->source_output->thread_info.delay_memblockq), &u->source_output->source->sample_spec);
|
||||
|
||||
/* Add resampler delay */
|
||||
*((int64_t*) data) += pa_resampler_get_delay_usec(u->source_output->thread_info.resampler);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,6 +177,9 @@ static int source_process_msg_cb(pa_msgobject *o, int code, void *data, int64_t
|
|||
/* FIXME, no idea what I am doing here */
|
||||
pa_bytes_to_usec(pa_memblockq_get_length(u->source_output->thread_info.delay_memblockq), &u->source_output->source->sample_spec);
|
||||
|
||||
/* Add resampler delay */
|
||||
*((int64_t*) data) += pa_resampler_get_delay_usec(u->source_output->thread_info.resampler);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue