object-manager: reduce the amount of globals that initially match the interest

With the previous check, any global matching either the type or the global
properties of the interest would be considered for inclusion in the object
manager and would be prepared only to fail the same check later.

The correct way to check is (variable & (X|Y) == (X|Y)), which is what
SPA_FLAG_IS_SET() expands to.

Fixes #517
This commit is contained in:
George Kiagiadakis
2023-10-23 23:04:02 +03:00
parent 686048d6fa
commit 5fc7e68d10

View File

@@ -638,8 +638,8 @@ wp_object_manager_is_interested_in_global (WpObjectManager * self,
/* and consider the manager interested if the type and the globals match...
if pw_properties / g_properties fail, that's ok because they are not
known yet (the proxy is likely NULL and properties not yet retrieved) */
if (match & (WP_INTEREST_MATCH_GTYPE |
WP_INTEREST_MATCH_PW_GLOBAL_PROPERTIES)) {
if (SPA_FLAG_IS_SET (match, (WP_INTEREST_MATCH_GTYPE |
WP_INTEREST_MATCH_PW_GLOBAL_PROPERTIES))) {
gpointer ft = g_hash_table_lookup (self->features,
GSIZE_TO_POINTER (global->type));
*wanted_features = (WpObjectFeatures) GPOINTER_TO_UINT (ft);