mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
audioadapter: recheck formats when EnumFormat changes
When the follower has new EnumFormat, make sure we recheck the formats the next time the node is started.
This commit is contained in:
parent
223d016a5e
commit
2c0bb6ffd2
1 changed files with 7 additions and 2 deletions
|
|
@ -89,6 +89,7 @@ struct impl {
|
||||||
|
|
||||||
unsigned int add_listener:1;
|
unsigned int add_listener:1;
|
||||||
unsigned int have_format:1;
|
unsigned int have_format:1;
|
||||||
|
unsigned int recheck_format:1;
|
||||||
unsigned int started:1;
|
unsigned int started:1;
|
||||||
unsigned int ready:1;
|
unsigned int ready:1;
|
||||||
unsigned int async:1;
|
unsigned int async:1;
|
||||||
|
|
@ -867,11 +868,14 @@ static int negotiate_format(struct impl *this)
|
||||||
struct spa_pod_builder b = { 0 };
|
struct spa_pod_builder b = { 0 };
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
spa_log_debug(this->log, "%p: have_format:%d", this, this->have_format);
|
spa_log_debug(this->log, "%p: have_format:%d recheck:%d", this, this->have_format,
|
||||||
|
this->recheck_format);
|
||||||
|
|
||||||
if (this->have_format)
|
if (this->have_format && !this->recheck_format)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
this->recheck_format = false;
|
||||||
|
|
||||||
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
spa_pod_builder_init(&b, buffer, sizeof(buffer));
|
||||||
|
|
||||||
spa_node_send_command(this->follower,
|
spa_node_send_command(this->follower,
|
||||||
|
|
@ -1300,6 +1304,7 @@ static void follower_port_info(void *data,
|
||||||
if (idx == IDX_EnumFormat) {
|
if (idx == IDX_EnumFormat) {
|
||||||
spa_log_debug(this->log, "new formats");
|
spa_log_debug(this->log, "new formats");
|
||||||
/* we will renegotiate when restarting */
|
/* we will renegotiate when restarting */
|
||||||
|
this->recheck_format = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->params[idx].user++;
|
this->params[idx].user++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue