mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
policy-node: only set PortConfig when we find a format
This commit is contained in:
parent
d2d1647634
commit
b4c76ba78a
1 changed files with 19 additions and 13 deletions
|
|
@ -96,6 +96,7 @@ static int activate_node(struct node *node)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
struct spa_pod_builder b = { 0, };
|
struct spa_pod_builder b = { 0, };
|
||||||
struct spa_pod *param;
|
struct spa_pod *param;
|
||||||
|
bool have_format = false;
|
||||||
|
|
||||||
pw_log_debug(NAME" %p: node %p activate", impl, node);
|
pw_log_debug(NAME" %p: node %p activate", impl, node);
|
||||||
|
|
||||||
|
|
@ -121,7 +122,11 @@ static int activate_node(struct node *node)
|
||||||
|
|
||||||
if (node->format.info.raw.channels < info.info.raw.channels)
|
if (node->format.info.raw.channels < info.info.raw.channels)
|
||||||
node->format = info;
|
node->format = info;
|
||||||
|
|
||||||
|
have_format = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (have_format) {
|
||||||
node->format.info.raw.rate = impl->sample_rate;
|
node->format.info.raw.rate = impl->sample_rate;
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buf, sizeof(buf));
|
spa_pod_builder_init(&b, buf, sizeof(buf));
|
||||||
|
|
@ -138,6 +143,7 @@ static int activate_node(struct node *node)
|
||||||
|
|
||||||
pw_node_set_param((struct pw_node*)node->obj->obj.proxy,
|
pw_node_set_param((struct pw_node*)node->obj->obj.proxy,
|
||||||
SPA_PARAM_PortConfig, 0, param);
|
SPA_PARAM_PortConfig, 0, param);
|
||||||
|
}
|
||||||
|
|
||||||
node->active = true;
|
node->active = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue