From 0cccff517bced17945e68e6287b4a22258adc113 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 5 Nov 2021 15:42:33 +0100 Subject: [PATCH] pulse-server: send the drained event only once Only send the drained command once. pw-stream keeps on emitting drained events as longs as the stream is drained. --- src/modules/module-protocol-pulse/pulse-server.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index c072352d8..92404ff0d 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1300,10 +1300,13 @@ static void stream_process(void *data) static void stream_drained(void *data) { struct stream *stream = data; - pw_log_info("%p: [%s] drained channel:%u", stream, - stream->client->name, stream->channel); - reply_simple_ack(stream->client, stream->drain_tag); - stream->drain_tag = 0; + if (stream->drain_tag != 0) { + pw_log_info("%p: [%s] drained channel:%u tag:%d", stream, + stream->client->name, stream->channel, + stream->drain_tag); + reply_simple_ack(stream->client, stream->drain_tag); + stream->drain_tag = 0; + } } static const struct pw_stream_events stream_events =