cae4d70f6f74dbe32bae936e50dcbf92655e2893
[AGL/meta-agl.git] / meta-pipewire / recipes-multimedia / pipewire / pipewire / 0006-alsa-pcm-call-reuse_buffers-when-resetting-the-state.patch
1 From 5946fbd2ca3a7f892b4ebc10090f62df6bb1ec88 Mon Sep 17 00:00:00 2001
2 From: George Kiagiadakis <george.kiagiadakis@collabora.com>
3 Date: Thu, 9 Jan 2020 19:27:23 +0200
4 Subject: [PATCH] alsa-pcm: call reuse_buffers when resetting the state of the
5  buffers
6
7 This allows the upstream node to put buffers back to its pool in case
8 they were left around in the ready list locally when the alsa-pcm-sink
9 was last paused.
10
11 Fixes #203
12 ---
13  spa/plugins/alsa/alsa-pcm.c | 1 +
14  1 file changed, 1 insertion(+)
15
16 diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c
17 index 63d75549..a6f22cf0 100644
18 --- a/spa/plugins/alsa/alsa-pcm.c
19 +++ b/spa/plugins/alsa/alsa-pcm.c
20 @@ -1115,6 +1115,7 @@ static void reset_buffers(struct state *this)
21                 struct buffer *b = &this->buffers[i];
22                 if (this->stream == SND_PCM_STREAM_PLAYBACK) {
23                         SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT);
24 +                       spa_node_call_reuse_buffer(&this->callbacks, 0, b->id);
25                 } else {
26                         spa_list_append(&this->free, &b->link);
27                         SPA_FLAG_CLEAR(b->flags, BUFFER_FLAG_OUT);
28 -- 
29 2.24.1
30