[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] null-sink: Request no more than the configured latency from sink-input
PulseAudio Marge Bot (@pulseaudio-merge-bot)
gitlab at gitlab.freedesktop.org
Mon May 17 14:49:28 UTC 2021
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210517/a50bd124/attachment.htm>
More information about the pulseaudio-commits
mailing list