mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
policy-node: give more priority to newer video output nodes
A slight workaround for old firefox that doesn't specify the target node, nor the media role when doing screen sharing.
This commit is contained in:
parent
3aa8e301c5
commit
88c6db8a82
1 changed files with 10 additions and 2 deletions
|
|
@ -208,8 +208,15 @@ handle_node(struct impl *impl, struct sm_object *object)
|
|||
else
|
||||
return 0;
|
||||
|
||||
if (strstr(media_class, "Video") == media_class)
|
||||
if (strstr(media_class, "Video") == media_class) {
|
||||
if (direction == PW_DIRECTION_OUTPUT) {
|
||||
if ((str = pw_properties_get(object->props, PW_KEY_NODE_PLUGGED)) != NULL)
|
||||
node->plugged = pw_properties_parse_uint64(str);
|
||||
else
|
||||
node->plugged = SPA_TIMESPEC_TO_NSEC(&impl->now);
|
||||
}
|
||||
node->active = true;
|
||||
}
|
||||
|
||||
node->direction = direction;
|
||||
node->type = NODE_TYPE_STREAM;
|
||||
|
|
@ -278,6 +285,8 @@ static void session_create(void *data, struct sm_object *object)
|
|||
struct impl *impl = data;
|
||||
int res;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &impl->now);
|
||||
|
||||
if (strcmp(object->type, PW_TYPE_INTERFACE_Node) == 0)
|
||||
res = handle_node(impl, object);
|
||||
else
|
||||
|
|
@ -516,7 +525,6 @@ static void session_rescan(void *data, int seq)
|
|||
struct impl *impl = data;
|
||||
struct node *node;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &impl->now);
|
||||
pw_log_debug(NAME" %p: rescan", impl);
|
||||
|
||||
spa_list_for_each(node, &impl->node_list, link)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue