mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30: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
|
|
@ -46,6 +46,22 @@ static inline void volume_make(struct volume *vol, uint8_t channels)
|
|||
vol->channels = channels;
|
||||
}
|
||||
|
||||
static inline int volume_compare(struct volume *vol, struct volume *other)
|
||||
{
|
||||
uint8_t i;
|
||||
if (vol->channels != other->channels) {
|
||||
pw_log_info("channels %d<>%d", vol->channels, other->channels);
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; i < vol->channels; i++) {
|
||||
if (vol->values[i] != other->values[i]) {
|
||||
pw_log_info("val %f<>%f", vol->values[i], other->values[i]);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct volume_info {
|
||||
struct volume volume;
|
||||
struct channel_map map;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue