resample: take into account the number of queued input samples

Take the queued input samples into account when calculating the
required input size. This can be 0 when there is still enough
data queued in the input for another period.

Handle 0 read_size in alsa-source and make it push out a 0 buffer,
this will then drain the resampler and make it ask for a new buffer
size. This makes the transition from one period to another more
seamless for the resampler.

Fixes #805
This commit is contained in:
Wim Taymans 2021-03-04 10:27:44 +01:00
parent e15104c5cb
commit 3af768f124
2 changed files with 14 additions and 4 deletions

View file

@ -1100,7 +1100,7 @@ push_frames(struct state *state,
if (spa_list_is_empty(&state->free)) {
spa_log_warn(state->log, NAME" %s: no more buffers", state->props.device);
total_frames = frames;
} else if (frames > 0) {
} else {
uint8_t *src;
size_t n_bytes, left;
struct buffer *b;