PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
dbaf4503 by Georg Chini at 2021-05-17T14:40:15+00: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>

- - - - -


1 changed file:

- src/modules/module-null-sink.c


Changes:

=====================================
src/modules/module-null-sink.c
=====================================
@@ -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); */



View it on GitLab: 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dbaf450394ddb4eef8a45bdedcb7ae7a569e0304

-- 
View it on GitLab: 
https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/dbaf450394ddb4eef8a45bdedcb7ae7a569e0304
You're receiving this email because of your account on gitlab.freedesktop.org.


_______________________________________________
pulseaudio-commits mailing list
pulseaudio-commits@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits

Reply via email to