mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: handle 0 id as default sink/source as well
Also handle 0 id as the default sink/source See #756
This commit is contained in:
parent
efd52d633f
commit
dd6a18d576
1 changed files with 4 additions and 4 deletions
|
|
@ -4538,8 +4538,11 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
|
|||
if (sel.id != SPA_ID_INVALID && sel.value != NULL)
|
||||
goto error_invalid;
|
||||
|
||||
pw_log_info(NAME" %p: [%s] %s tag:%u idx:%u name:%s", impl, client->name,
|
||||
commands[command].name, tag, sel.id, sel.value);
|
||||
|
||||
if (command == COMMAND_GET_SINK_INFO || command == COMMAND_GET_SOURCE_INFO) {
|
||||
if ((sel.value == NULL && sel.id == SPA_ID_INVALID) ||
|
||||
if ((sel.value == NULL && (sel.id == SPA_ID_INVALID || sel.id == 0)) ||
|
||||
(sel.value != NULL && (strcmp(sel.value, def) == 0 || strcmp(sel.value, "0")) == 0))
|
||||
sel.value = get_default(client, command == COMMAND_GET_SINK_INFO);
|
||||
} else {
|
||||
|
|
@ -4547,9 +4550,6 @@ static int do_get_info(struct client *client, uint32_t command, uint32_t tag, st
|
|||
goto error_invalid;
|
||||
}
|
||||
|
||||
pw_log_info(NAME" %p: [%s] %s tag:%u idx:%u name:%s", impl, client->name,
|
||||
commands[command].name, tag, sel.id, sel.value);
|
||||
|
||||
if (command == COMMAND_GET_SOURCE_INFO &&
|
||||
sel.value != NULL && pw_endswith(sel.value, ".monitor")) {
|
||||
sel.value = strndupa(sel.value, strlen(sel.value)-8);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue