From c135f9c7eee6b0d79565c1f16d7cfce5fc013aa3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Mar 2021 10:13:26 +0100 Subject: [PATCH] alsa: always set read_size --- spa/plugins/alsa/alsa-pcm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index a8d0f0e75..bd6d2c681 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -838,7 +838,8 @@ static int get_status(struct state *state, snd_pcm_uframes_t *delay, snd_pcm_ufr else *target -= state->delay; } else { - state->delay = state->read_size = 0; + state->delay = 0; + state->read_size = state->threshold; } if (state->stream == SND_PCM_STREAM_PLAYBACK) { @@ -1217,8 +1218,6 @@ int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence) } frames = state->read_size; - if (frames == 0) - frames = state->threshold + state->delay; if (state->use_mmap) { to_read = state->buffer_frames;