mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
null-sink: Request no more than the configured latency from sink-input
In the case, where the latency is larger than the maximum block size, module-null-sink will request multiples of the maximum block size from the sink input instead of limiting the requested amount of data to the the configured latency. This patch fixes the problem. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/554>
This commit is contained in:
parent
80efd7a64c
commit
dbaf450394
1 changed files with 5 additions and 1 deletions
|
|
@ -223,8 +223,12 @@ static void process_render(struct userdata *u, pa_usec_t now) {
|
|||
/* Fill the buffer up the latency size */
|
||||
while (u->timestamp < now + u->block_usec) {
|
||||
pa_memchunk chunk;
|
||||
size_t request_size;
|
||||
|
||||
request_size = pa_usec_to_bytes(now + u->block_usec - u->timestamp, &u->sink->sample_spec);
|
||||
request_size = PA_MIN(request_size, u->sink->thread_info.max_request);
|
||||
pa_sink_render(u->sink, request_size, &chunk);
|
||||
|
||||
pa_sink_render(u->sink, u->sink->thread_info.max_request, &chunk);
|
||||
pa_memblock_unref(chunk.memblock);
|
||||
|
||||
/* pa_log_debug("Ate %lu bytes.", (unsigned long) chunk.length); */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue