mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-05 06:46:28 -04:00
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:
parent
17723bc00d
commit
cda2e2ee17
1 changed files with 2 additions and 2 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue