resample: tweak the resampler to keep delay number of samples

Instead of requiring the upstream node to resubmit the delayed
samples, keep the samples ourselves. The benefit is probably too
small to measure but it simplifies things a lot.
This commit is contained in:
Wim Taymans 2021-01-08 16:35:26 +01:00
parent 84eed9ef6f
commit 7f007b6bca
3 changed files with 12 additions and 12 deletions

View file

@ -1074,8 +1074,7 @@ static snd_pcm_uframes_t
push_frames(struct state *state,
const snd_pcm_channel_area_t *my_areas,
snd_pcm_uframes_t offset,
snd_pcm_uframes_t frames,
snd_pcm_uframes_t keep)
snd_pcm_uframes_t frames)
{
snd_pcm_uframes_t total_frames = 0;
@ -1134,9 +1133,7 @@ push_frames(struct state *state,
}
spa_list_append(&state->ready, &b->link);
}
if (my_areas == NULL)
snd_pcm_rewind(state->hndl, keep);
return total_frames - keep;
return total_frames;
}
@ -1217,7 +1214,7 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence)
offset = 0;
}
read = push_frames(state, my_areas, offset, frames, state->delay);
read = push_frames(state, my_areas, offset, frames);
total_read += read;