wireplumber/0007-default-nodes-check-if-the-ports-exist-in-rescan_om.patch
Antonio Larrosa 23c5d9eadf Accepting request 948445 from home:alarrosa:branches:multimedia:libs
- Back to version 0.4.6, and add patches incrementally
  to bisect it and find the issue
  * 0001-policy-node-fix-typo-when-finding-best-target.patch
  * 0002-policy-node-schedule-a-rescan-without-timeout-if-def.patch
  * 0003-policy-node-find-best-linkable-if-default-one-cannot.patch
  * 0004-spa-pod-fix-different-architecture-errors-for-boolea.patch
  * 0005-config-update-the-endpoints-config.patch
  * 0006-policy-endpoint-client.lua-fix-record-with-endpoints.patch
  * 0007-default-nodes-check-if-the-ports-exist-in-rescan_om.patch
  * 0008-scripts-monitors-log-warning-if-spa-devices-were-not.patch
- Remove revert from previous change:
  * 0001-reversed-default-nodes-check-if-default-node-has-available-ro.patch

OBS-URL: https://build.opensuse.org/request/show/948445
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=24
2022-01-24 16:17:22 +00:00

48 lines
1.9 KiB
Diff

From 07a0a5b4043ab5982a82311e031ddfd6feb80da1 Mon Sep 17 00:00:00 2001
From: Julian Bouzas <julian.bouzas@collabora.com>
Date: Tue, 11 Jan 2022 07:50:15 -0500
Subject: [PATCH 07/14] default-nodes: check if the ports exist in rescan_om
Ports might not be ready in the node's port object manager yet.
Fixes #153 and #150
---
modules/module-default-nodes.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/modules/module-default-nodes.c b/modules/module-default-nodes.c
index 31eafcf..c45be2d 100644
--- a/modules/module-default-nodes.c
+++ b/modules/module-default-nodes.c
@@ -307,7 +307,12 @@ nodes_ready (WpDefaultNodes * self)
PW_KEY_DEVICE_ID, "=i", device_id, NULL);
for (; wp_iterator_next (node_it, &node_val); g_value_unset (&node_val)) {
WpPipewireObject *node = g_value_get_object (&node_val);
- if (wp_node_get_n_ports (WP_NODE (node)) > 0)
+ g_autoptr (WpPort) port =
+ wp_object_manager_lookup (self->rescan_om,
+ WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY,
+ PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)),
+ NULL);
+ if (port)
ready_nodes++;
}
@@ -327,7 +332,12 @@ nodes_ready (WpDefaultNodes * self)
WpPipewireObject *node = g_value_get_object (&node_val);
const gchar *media_class = wp_pipewire_object_get_property (
WP_PIPEWIRE_OBJECT (node), PW_KEY_MEDIA_CLASS);
- if (wp_node_get_n_ports (WP_NODE (node)) == 0 &&
+ g_autoptr (WpPort) port =
+ wp_object_manager_lookup (self->rescan_om,
+ WP_TYPE_PORT, WP_CONSTRAINT_TYPE_PW_PROPERTY,
+ PW_KEY_NODE_ID, "=u", wp_proxy_get_bound_id (WP_PROXY (node)),
+ NULL);
+ if (!port &&
(g_strcmp0 ("Audio/Source/Virtual", media_class) == 0 ||
g_strcmp0 ("Video/Source/Virtual", media_class) == 0))
return FALSE;
--
2.34.1