mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
stream: check requested before use
It can be 0 and so we should fill the complete buffer. Fixes #3683
This commit is contained in:
parent
0a7f8128a3
commit
94f898ddc5
2 changed files with 5 additions and 2 deletions
|
|
@ -73,7 +73,9 @@ static void on_process(void *userdata)
|
|||
return;
|
||||
|
||||
stride = sizeof(float) * DEFAULT_CHANNELS;
|
||||
n_frames = SPA_MIN(b->requested, buf->datas[0].maxsize / stride);
|
||||
n_frames = buf->datas[0].maxsize / stride;
|
||||
if (b->requested)
|
||||
n_frames = SPA_MIN((int)b->requested, n_frames);
|
||||
|
||||
fill_f32(data, p, n_frames);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue