From 55bd34c9e7d59fd311090aa6a0b09fe1fb98681e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 16 Nov 2020 15:47:13 +0100 Subject: [PATCH] pulse-server: always ask for tlength samples after flush --- src/modules/module-protocol-pulse/pulse-server.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 474c0b38c..03226fcbd 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -801,12 +801,9 @@ static int do_subscribe(struct client *client, uint32_t command, uint32_t tag, s static void stream_flush(struct stream *stream) { - uint32_t old; - - old = stream->ring.writeindex; - stream->ring.writeindex = stream->ring.readindex; - stream->missing += (old - stream->ring.writeindex); - stream->write_index = stream->read_index = stream->ring.writeindex; + stream->write_index = stream->read_index = + stream->ring.writeindex = stream->ring.readindex; + stream->missing = stream->attr.tlength; if (stream->attr.prebuf > 0) stream->in_prebuf = true;