From 0870fc8673f7e7815592c4dd7d946d16e46dbc66 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 9 Oct 2018 16:37:49 +0200 Subject: [PATCH] stream: use latency of minreq/2 Because we don't buffer tlength on the server side, we need to use half of the minreq as headroom in the server. --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index ace3c65b7..0708e617e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -849,7 +849,7 @@ static int create_stream(pa_stream_direction_t direction, props = (struct pw_properties *) pw_stream_get_properties(s->stream); pw_properties_setf(props, "node.latency", "%u/%u", - s->buffer_attr.minreq / stride, sample_rate); + (s->buffer_attr.minreq / 2) / stride, sample_rate); pw_properties_set(props, PW_NODE_PROP_MEDIA, "Audio"); pw_properties_set(props, PW_NODE_PROP_CATEGORY, direction == PA_STREAM_PLAYBACK ?