impl-node: add node.transport.sync property

When the node support transport sync. That is, when it will clear the
pending_sync flag from its activation area when it completed a new
seek.

Before this patch, the pending sync was always automatically cleared,
which broke some applications that are time masters such as bitwig.

Fixes #1589
This commit is contained in:
Wim Taymans 2021-09-14 11:00:08 +02:00
parent 47a46e198f
commit 7543ad0766
3 changed files with 8 additions and 3 deletions

View file

@ -3078,6 +3078,7 @@ jack_client_t * jack_client_open (const char *client_name,
pw_properties_set(client->props, PW_KEY_MEDIA_ROLE, "DSP");
if (pw_properties_get(client->props, PW_KEY_NODE_ALWAYS_PROCESS) == NULL)
pw_properties_set(client->props, PW_KEY_NODE_ALWAYS_PROCESS, "true");
pw_properties_set(client->props, "node.transport.sync", "true");
client->node = pw_core_create_object(client->core,
"client-node",

View file

@ -843,6 +843,9 @@ static void check_properties(struct pw_impl_node *node)
str = pw_properties_get(node->properties, PW_KEY_NODE_CACHE_PARAMS);
impl->cache_params = str ? pw_properties_parse_bool(str) : true;
str = pw_properties_get(node->properties, "node.transport.sync");
node->transport_sync = str ? pw_properties_parse_bool(str) : false;
str = pw_properties_get(node->properties, PW_KEY_NODE_DRIVER);
driver = str ? pw_properties_parse_bool(str) : false;
@ -1028,9 +1031,9 @@ static inline int process_node(void *data)
pw_log_trace_fp(NAME" %p: process %"PRIu64, this, a->awake_time);
/* not implemented yet, just clear the flags */
a->pending_sync = false;
a->pending_new_pos = false;
/* when transport sync is not supported, just clear the flag */
if (!this->transport_sync)
a->pending_sync = false;
spa_list_for_each(p, &this->rt.input_mix, rt.node_link)
spa_node_process(p->mix);

View file

@ -682,6 +682,7 @@ struct pw_impl_node {
unsigned int always_process:1; /**< this node wants to always be processing, even when idle */
unsigned int lock_quantum:1; /**< don't change graph quantum */
unsigned int lock_rate:1; /**< don't change graph rate */
unsigned int transport_sync:1; /**< supports transport sync */
uint32_t port_user_data_size; /**< extra size for port user data */