1 From ddcda9fa6ec49168c5ddd9fbeda748c5fad18fce Mon Sep 17 00:00:00 2001
2 From: George Kiagiadakis <george.kiagiadakis@collabora.com>
3 Date: Wed, 10 Jul 2019 14:53:15 +0300
4 Subject: [PATCH] audioconvert: do setup internal links and buffers also in
7 Upstream-Status: Submitted [https://github.com/PipeWire/pipewire/pull/167]
9 spa/plugins/audioconvert/audioconvert.c | 10 ++++++----
10 1 file changed, 6 insertions(+), 4 deletions(-)
12 diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c
13 index fa8dec97..0af0732d 100644
14 --- a/spa/plugins/audioconvert/audioconvert.c
15 +++ b/spa/plugins/audioconvert/audioconvert.c
16 @@ -79,6 +79,8 @@ struct impl {
18 #define MODE_CONVERT 2
21 + bool buffers_set[2];
24 struct spa_handle *hnd_fmt[2];
25 @@ -791,11 +793,11 @@ impl_node_port_set_param(struct spa_node *node,
26 if (id == SPA_PARAM_Format) {
29 - else if ((direction == SPA_DIRECTION_OUTPUT && this->mode == MODE_MERGE) ||
30 - (direction == SPA_DIRECTION_INPUT && this->mode == MODE_SPLIT)) {
31 + else if (this->fmt_is_set[SPA_DIRECTION_REVERSE(direction)]) {
32 if ((res = setup_convert(this)) < 0)
35 + this->fmt_is_set[direction] = (param != NULL);
39 @@ -824,11 +826,11 @@ impl_node_port_use_buffers(struct spa_node *node,
40 direction, port_id, buffers, n_buffers)) < 0)
43 - if ((direction == SPA_DIRECTION_OUTPUT && this->mode == MODE_MERGE) ||
44 - (direction == SPA_DIRECTION_INPUT && this->mode == MODE_SPLIT)) {
45 + if (buffers && this->buffers_set[SPA_DIRECTION_REVERSE(direction)]) {
46 if ((res = setup_buffers(this, SPA_DIRECTION_INPUT)) < 0)
49 + this->buffers_set[direction] = (buffers != NULL);