From 8c4145291eb3a365d8be53c011c049c6b02a2612 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 5 Dec 2020 13:27:42 +0100 Subject: [PATCH] pulse-server: name and id can't be both set in volume/mute --- src/modules/module-protocol-pulse/pulse-server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c index 0583db5ce..f6416fd55 100644 --- a/src/modules/module-protocol-pulse/pulse-server.c +++ b/src/modules/module-protocol-pulse/pulse-server.c @@ -2788,7 +2788,8 @@ static int do_set_volume(struct client *client, uint32_t command, uint32_t tag, pw_log_info(NAME" %p: [%s] %s tag:%u index:%u name:%s", impl, client->name, commands[command].name, tag, id, name); - if (id == SPA_ID_INVALID && name == NULL) + if ((id == SPA_ID_INVALID && name == NULL) || + (id != SPA_ID_INVALID && name != NULL)) return -EINVAL; if (command == COMMAND_SET_SINK_VOLUME) @@ -2847,7 +2848,8 @@ static int do_set_mute(struct client *client, uint32_t command, uint32_t tag, st pw_log_info(NAME" %p: [%s] %s tag:%u index:%u name:%s mute:%d", impl, client->name, commands[command].name, tag, id, name, mute); - if (id == SPA_ID_INVALID && name == NULL) + if ((id == SPA_ID_INVALID && name == NULL) || + (id != SPA_ID_INVALID && name != NULL)) return -EINVAL; if (command == COMMAND_SET_SINK_MUTE)