mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-02 06:46:36 -04:00
pulse: handle wraparound near the end correctly
If offsetis near MAXLENGTH, we can still read past the end of the buffer. Use the ringbuffer to wraparound.
This commit is contained in:
parent
b9b93f3cdb
commit
32648b7cc7
1 changed files with 2 additions and 1 deletions
|
|
@ -100,7 +100,8 @@ static void sample_play_stream_process(void *data)
|
|||
if (b->requested)
|
||||
size = SPA_MIN(size, b->requested * p->stride);
|
||||
|
||||
memcpy(d, s->buffer + (p->offset % MAXLENGTH), size);
|
||||
spa_ringbuffer_read_data(NULL, s->buffer, MAXLENGTH,
|
||||
p->offset % MAXLENGTH, d, size);
|
||||
|
||||
p->offset += size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue