mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
audioconvert: do setup internal links and buffers also in convert mode
This commit is contained in:
parent
6fc02ca5e0
commit
129ccd3a3e
1 changed files with 6 additions and 4 deletions
|
|
@ -80,6 +80,8 @@ struct impl {
|
||||||
#define MODE_MERGE 1
|
#define MODE_MERGE 1
|
||||||
#define MODE_CONVERT 2
|
#define MODE_CONVERT 2
|
||||||
int mode;
|
int mode;
|
||||||
|
bool fmt_is_set[2];
|
||||||
|
bool buffers_set[2];
|
||||||
bool started;
|
bool started;
|
||||||
|
|
||||||
struct spa_handle *hnd_fmt[2];
|
struct spa_handle *hnd_fmt[2];
|
||||||
|
|
@ -780,11 +782,11 @@ impl_node_port_set_param(void *object,
|
||||||
if (id == SPA_PARAM_Format) {
|
if (id == SPA_PARAM_Format) {
|
||||||
if (param == NULL)
|
if (param == NULL)
|
||||||
clean_convert(this);
|
clean_convert(this);
|
||||||
else if ((direction == SPA_DIRECTION_OUTPUT && this->mode == MODE_MERGE) ||
|
else if (this->fmt_is_set[SPA_DIRECTION_REVERSE(direction)]) {
|
||||||
(direction == SPA_DIRECTION_INPUT && this->mode == MODE_SPLIT)) {
|
|
||||||
if ((res = setup_convert(this)) < 0)
|
if ((res = setup_convert(this)) < 0)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
this->fmt_is_set[direction] = (param != NULL);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -811,11 +813,11 @@ impl_node_port_use_buffers(void *object,
|
||||||
direction, port_id, buffers, n_buffers)) < 0)
|
direction, port_id, buffers, n_buffers)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
if ((direction == SPA_DIRECTION_OUTPUT && this->mode == MODE_MERGE) ||
|
if (buffers && this->buffers_set[SPA_DIRECTION_REVERSE(direction)]) {
|
||||||
(direction == SPA_DIRECTION_INPUT && this->mode == MODE_SPLIT)) {
|
|
||||||
if ((res = setup_buffers(this, SPA_DIRECTION_INPUT)) < 0)
|
if ((res = setup_buffers(this, SPA_DIRECTION_INPUT)) < 0)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
this->buffers_set[direction] = (buffers != NULL);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue