From b9c646074dea38f0791025ad3556b75dab23076f Mon Sep 17 00:00:00 2001 From: Chris Spencer Date: Mon, 10 Jan 2022 19:29:57 +0000 Subject: [PATCH] [client] audio/pw: don't discard playback data This can cause significant glitching, particularly around the start of playback. --- AUTHORS | 1 + client/audiodevs/PipeWire/pipewire.c | 11 ----------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4a064ce9..b336d217 100644 --- a/AUTHORS +++ b/AUTHORS @@ -57,3 +57,4 @@ SytheZN (SytheZN) RTXUX (RTXUX) Vincent LaRocca (VMFortress) Johnathon Paul Weaver (8BallBomBom) +Chris Spencer (spencercw) diff --git a/client/audiodevs/PipeWire/pipewire.c b/client/audiodevs/PipeWire/pipewire.c index a4f1319a..d0dabfc3 100644 --- a/client/audiodevs/PipeWire/pipewire.c +++ b/client/audiodevs/PipeWire/pipewire.c @@ -215,17 +215,6 @@ static void pipewire_playbackPlay(uint8_t * data, size_t size) if (!pw.playback.stream) return; - // if the buffer fill is higher then the average skip the update to reduce lag - static unsigned int ttlSize = 0; - static unsigned int count = 0; - ttlSize += size; - if (++count > 100 && ringbuffer_getCount(pw.playback.buffer) > ttlSize / count) - { - count = 0; - ttlSize = 0; - return; - } - ringbuffer_append(pw.playback.buffer, data, size / pw.playback.stride); if (!pw.playback.active)