audio-src: queued only requested frames

Use the new requested buffer field to only queue the amount of samples
required by the resampler for the current quantum. This avoid spikes
when the maxsize block of samples is processed.

Fixes #2353
This commit is contained in:
Wim Taymans 2022-05-02 16:55:53 +02:00
parent 6a8bdf1bfe
commit 777a8c687b

View file

@ -93,7 +93,7 @@ static void on_process(void *userdata)
return; return;
stride = sizeof(float) * DEFAULT_CHANNELS; stride = sizeof(float) * DEFAULT_CHANNELS;
n_frames = buf->datas[0].maxsize / stride; n_frames = SPA_MIN(b->requested, buf->datas[0].maxsize / stride);
fill_f32(data, p, n_frames); fill_f32(data, p, n_frames);