mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-15 12:22:47 +00:00
alsa: never queue buffers when rate matching
When we are following the resampler requested size in capture, never keep queued buffers around or we might get out of sync with the requested size and cause cracks and pops in the resampler. See #805
This commit is contained in:
parent
34800dc019
commit
8c334fa3ab
|
@ -1147,6 +1147,9 @@ push_frames(struct state *state,
|
|||
snd_pcm_readi(state->hndl, bufs[0], total_frames);
|
||||
}
|
||||
}
|
||||
spa_log_trace_fp(state->log, NAME" %p: wrote %ld frames into buffer %d",
|
||||
state, total_frames, b->id);
|
||||
|
||||
spa_list_append(&state->ready, &b->link);
|
||||
}
|
||||
return total_frames;
|
||||
|
@ -1307,7 +1310,8 @@ static int handle_capture(struct state *state, uint64_t nsec,
|
|||
return 0;
|
||||
|
||||
io = state->io;
|
||||
if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) {
|
||||
if (io != NULL &&
|
||||
(io->status != SPA_STATUS_HAVE_DATA || state->rate_match != NULL)) {
|
||||
struct buffer *b;
|
||||
|
||||
if (io->buffer_id < state->n_buffers)
|
||||
|
|
Loading…
Reference in a new issue