From 3ff1e645a14ad91dcb6cec60a6e07b8b41b7154c Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Tue, 28 Nov 2023 16:12:13 +0100 Subject: [PATCH] aurecv: fix cracking audio on start --- src/aureceiver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aureceiver.c b/src/aureceiver.c index 18d5b7134f..7e4fb463aa 100644 --- a/src/aureceiver.c +++ b/src/aureceiver.c @@ -534,7 +534,11 @@ void aur_read(struct audio_recv *ar, struct auframe *af) if (!ar || mtx_trylock(ar->aubuf_mtx) != thrd_success) return; - aubuf_read_auframe(ar->aubuf, af); + if (ar->aubuf) + aubuf_read_auframe(ar->aubuf, af); + else + memset(af->sampv, 0, auframe_size(af)); + mtx_unlock(ar->aubuf_mtx); }