pipewire-pulse: moving DONT_MOVE streams should fail

Pulseaudio return EINVAL for attempts to move DONT_MOVE streams.
This commit is contained in:
Pauli Virtanen 2022-02-20 01:20:29 +02:00
parent d1f7e96f82
commit c4997fc46d

View file

@ -4610,6 +4610,7 @@ static int do_move_stream(struct client *client, uint32_t command, uint32_t tag,
uint32_t index, index_device; uint32_t index, index_device;
int target_id; int target_id;
const char *name_device; const char *name_device;
struct pw_node_info *info;
struct selector sel; struct selector sel;
int res; int res;
bool sink = command == COMMAND_MOVE_SINK_INPUT; bool sink = command == COMMAND_MOVE_SINK_INPUT;
@ -4636,6 +4637,12 @@ static int do_move_stream(struct client *client, uint32_t command, uint32_t tag,
if (o == NULL) if (o == NULL)
return -ENOENT; return -ENOENT;
info = o->info;
if (info == NULL || info->props == NULL)
return -EINVAL;
if (spa_atob(spa_dict_lookup(info->props, PW_KEY_NODE_DONT_RECONNECT)))
return -EINVAL;
if ((dev = find_device(client, index_device, name_device, sink, NULL)) == NULL) if ((dev = find_device(client, index_device, name_device, sink, NULL)) == NULL)
return -ENOENT; return -ENOENT;