mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-02-07 04:06:12 -05:00
pulse-server: try to avoid setting the same volume/mute
This commit is contained in:
parent
c3c6dcf53f
commit
c140a573be
2 changed files with 26 additions and 1 deletions
|
|
@ -2998,6 +2998,10 @@ static int do_set_volume(struct client *client, uint32_t command, uint32_t tag,
|
|||
}
|
||||
collect_device_info(o, card, &dev_info);
|
||||
|
||||
if (dev_info.have_volume &&
|
||||
volume_compare(&dev_info.volume_info.volume, &volume) == 0)
|
||||
goto done;
|
||||
|
||||
if (card != NULL && dev_info.active_port != SPA_ID_INVALID)
|
||||
res = set_card_volume_mute(card, dev_info.active_port,
|
||||
dev_info.device, &volume, NULL);
|
||||
|
|
@ -3007,6 +3011,7 @@ static int do_set_volume(struct client *client, uint32_t command, uint32_t tag,
|
|||
if (res < 0)
|
||||
return res;
|
||||
|
||||
done:
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
||||
|
|
@ -3058,6 +3063,10 @@ static int do_set_mute(struct client *client, uint32_t command, uint32_t tag, st
|
|||
}
|
||||
collect_device_info(o, card, &dev_info);
|
||||
|
||||
if (dev_info.have_volume &&
|
||||
dev_info.volume_info.mute == mute)
|
||||
goto done;
|
||||
|
||||
if (card != NULL && dev_info.active_port != SPA_ID_INVALID)
|
||||
res = set_card_volume_mute(card, dev_info.active_port,
|
||||
dev_info.device, NULL, &mute);
|
||||
|
|
@ -3066,7 +3075,7 @@ static int do_set_mute(struct client *client, uint32_t command, uint32_t tag, st
|
|||
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
done:
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue