mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
doc: use b->requested in tutorial4
This commit is contained in:
parent
49668a9b26
commit
27afa39d5d
1 changed files with 2 additions and 0 deletions
|
|
@ -42,6 +42,8 @@ static void on_process(void *userdata)
|
||||||
|
|
||||||
stride = sizeof(int16_t) * DEFAULT_CHANNELS;
|
stride = sizeof(int16_t) * DEFAULT_CHANNELS;
|
||||||
n_frames = buf->datas[0].maxsize / stride;
|
n_frames = buf->datas[0].maxsize / stride;
|
||||||
|
if (b->requested)
|
||||||
|
n_frames = SPA_MIN(b->requested, n_frames);
|
||||||
|
|
||||||
for (i = 0; i < n_frames; i++) {
|
for (i = 0; i < n_frames; i++) {
|
||||||
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
data->accumulator += M_PI_M2 * 440 / DEFAULT_RATE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue