pulse-server: find the sink when doing monitor source lookup

When we do a lookup of a source with the monitor flag bits set in the
id, strip off the monitor bits se we can find the associated sink.

Fixes #1677
This commit is contained in:
Wim Taymans 2021-10-11 17:02:13 +02:00
parent 38981a4c8c
commit 9afb832d22

View file

@ -3996,9 +3996,11 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
goto error_invalid;
}
if (command == COMMAND_GET_SOURCE_INFO &&
sel.value != NULL && spa_strendswith(sel.value, ".monitor")) {
sel.value = strndupa(sel.value, strlen(sel.value)-8);
if (command == COMMAND_GET_SOURCE_INFO) {
if (sel.value != NULL && spa_strendswith(sel.value, ".monitor"))
sel.value = strndupa(sel.value, strlen(sel.value)-8);
if (sel.id & MONITOR_FLAG)
sel.id &= INDEX_MASK;
}
o = select_object(manager, &sel);