alsa: fix buffer recycle

We only set the OUT flag when we put the buffer on an io area and
might need to recycle later.
Before placing the output buffer into the io area, recycle any
buffer that might be left in there.
Only emit the ready callback when we have some data queued.
This commit is contained in:
Wim Taymans 2020-03-19 13:12:49 +01:00
parent acccccd2c0
commit 441fdb2333
3 changed files with 31 additions and 22 deletions

View file

@ -172,6 +172,8 @@ int spa_alsa_close(struct state *state);
int spa_alsa_write(struct state *state, snd_pcm_uframes_t silence);
int spa_alsa_read(struct state *state, snd_pcm_uframes_t silence);
void spa_alsa_recycle_buffer(struct state *state, uint32_t buffer_id);
#ifdef __cplusplus
} /* extern "C" */
#endif