From b65b291bb27b19cff8a67f18ab9b3f1791c72da6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 28 Jan 2021 18:59:03 +0100 Subject: [PATCH] pulse-server: make sure to count played samples On underrun we need to keep on counting playing_for so fill this in underrun and don't add this to missing to avoid double counting. See #639 --- src/modules/module-protocol-pulse/pulse-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 9769f5364..8e020980a 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -1462,7 +1462,7 @@ do_process_done(struct spa_loop *loop, else send_stream_started(stream); } - stream->missing += pd->playing_for + pd->underrun_for; + stream->missing += pd->playing_for; stream->missing = SPA_MIN(stream->missing, stream->attr.tlength); stream->playing_for += pd->playing_for; if (stream->underrun_for != (uint64_t)-1) @@ -1559,6 +1559,7 @@ static void stream_process(void *data) pw_stream_flush(stream->stream, true); } else { pd.underrun_for = size; + pd.playing_for = size; pd.underrun = true; } pd.read_index += size;