rtp: fix ringbuffer overflow check

We write raw samples to the ringbuffer from the opus decode function so
compare the available space to the max amount of samples we can decode,
which is 2880 as passed to opus_decode.
This commit is contained in:
Wim Taymans 2026-05-04 10:26:30 +02:00
parent 17723bc00d
commit cda2e2ee17

View file

@ -167,8 +167,8 @@ static int rtp_opus_receive(struct impl *impl, uint8_t *buffer, ssize_t len,
write, expected_write); write, expected_write);
} }
if (filled + plen > BUFFER_SIZE2 / stride) { if (filled + 2880 > (int32_t)(BUFFER_SIZE2 / stride)) {
pw_log_debug("capture overrun %u + %zd > %u", filled, plen, pw_log_debug("capture overrun %u + %d > %u", filled, 2880,
BUFFER_SIZE2 / stride); BUFFER_SIZE2 / stride);
impl->have_sync = false; impl->have_sync = false;
} else { } else {