From 0c63d045eee1a15a8fdd9adb562daba5dbafe768 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Thu, 9 Jan 2020 19:27:23 +0200 Subject: [PATCH] alsa-pcm: call reuse_buffers when resetting the state of the buffers This allows the upstream node to put buffers back to its pool in case they were left around in the ready list locally when the alsa-pcm-sink was last paused. Fixes #203 --- spa/plugins/alsa/alsa-pcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 6e4cadc50..1b98667c3 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1117,6 +1117,7 @@ static void reset_buffers(struct state *this) struct buffer *b = &this->buffers[i]; if (this->stream == SND_PCM_STREAM_PLAYBACK) { SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT); + spa_node_call_reuse_buffer(&this->callbacks, 0, b->id); } else { spa_list_append(&this->free, &b->link); SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);