alsa: set buffer_id in io to INVALID when in use

This commit is contained in:
Wim Taymans 2018-11-12 09:56:45 +01:00
parent 0f7a3bdb2a
commit 6f555c63e2
2 changed files with 2 additions and 0 deletions

View file

@ -656,6 +656,7 @@ static int impl_node_process(struct spa_node *node)
spa_log_trace(this->log, NAME " %p: queue buffer %u", this, input->buffer_id);
spa_list_append(&this->ready, &b->link);
SPA_FLAG_UNSET(b->flags, BUFFER_FLAG_OUT);
input->buffer_id = SPA_ID_INVALID;
spa_alsa_write(this, 0);

View file

@ -587,6 +587,7 @@ int spa_alsa_write(struct state *state, snd_pcm_uframes_t silence)
if (state->ready_offset >= size) {
spa_list_remove(&b->link);
SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
state->io->buffer_id = b->buf->id;
spa_log_trace(state->log, "alsa-util %p: reuse buffer %u", state, b->buf->id);
state->callbacks->reuse_buffer(state->callbacks_data, 0, b->buf->id);
state->ready_offset = 0;