Jack: Fix jack_remove_property(ies) to use proxy id

These functions were using the object serial as the object id
This commit is contained in:
Dimitrios Katsaros 2024-02-07 14:37:56 +01:00
parent 1de71d96c6
commit 44b8a03c40

View file

@ -324,7 +324,8 @@ SPA_EXPORT
int jack_remove_property (jack_client_t* client, jack_uuid_t subject, const char* key)
{
struct client *c = (struct client *) client;
uint32_t id;
struct object *o;
uint32_t serial;
int res = -1;
spa_return_val_if_fail(c != NULL, -EINVAL);
@ -335,11 +336,16 @@ int jack_remove_property (jack_client_t* client, jack_uuid_t subject, const char
if (c->metadata == NULL)
goto done;
id = jack_uuid_to_index(subject);
if (subject & (1<<30))
goto done;
pw_log_info("remove id:%u (%"PRIu64") '%s'", id, subject, key);
serial = jack_uuid_to_index(subject);
if ((o = find_by_serial(c, serial)) == NULL)
goto done;
pw_log_info("remove id:%u (%"PRIu64") '%s'", o->id, subject, key);
pw_metadata_set_property(c->metadata->proxy,
id, key, NULL, NULL);
o->id, key, NULL, NULL);
res = do_sync(c);
done:
pw_thread_loop_unlock(c->context.loop);
@ -351,7 +357,8 @@ SPA_EXPORT
int jack_remove_properties (jack_client_t* client, jack_uuid_t subject)
{
struct client *c = (struct client *) client;
uint32_t id;
struct object *o;
uint32_t serial;
int res = -1;
spa_return_val_if_fail(c != NULL, -EINVAL);
@ -360,11 +367,16 @@ int jack_remove_properties (jack_client_t* client, jack_uuid_t subject)
if (c->metadata == NULL)
goto done;
id = jack_uuid_to_index(subject);
if (subject & (1<<30))
goto done;
pw_log_info("remove id:%u (%"PRIu64")", id, subject);
serial = jack_uuid_to_index(subject);
if ((o = find_by_serial(c, serial)) == NULL)
goto done;
pw_log_info("remove id:%u (%"PRIu64")", o->id, subject);
pw_metadata_set_property(c->metadata->proxy,
id, NULL, NULL, NULL);
o->id, NULL, NULL, NULL);
res = do_sync(c);
done:
pw_thread_loop_unlock(c->context.loop);