mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pipewire-pulse: Don't send sink-input volume updates unless it has actually changed
This commit is contained in:
parent
2104004382
commit
3c0821775f
1 changed files with 8 additions and 0 deletions
|
|
@ -2872,6 +2872,10 @@ static int do_set_stream_volume(struct client *client, uint32_t command, uint32_
|
|||
|
||||
stream = find_stream(client, id);
|
||||
if (stream != NULL) {
|
||||
|
||||
if (volume_compare(&stream->volume, &volume) == 0)
|
||||
goto done;
|
||||
|
||||
stream->volume = volume;
|
||||
stream->volume_set = true;
|
||||
|
||||
|
|
@ -2896,6 +2900,7 @@ static int do_set_stream_volume(struct client *client, uint32_t command, uint32_
|
|||
if ((res = set_node_volume_mute(o, &volume, NULL)) < 0)
|
||||
return res;
|
||||
}
|
||||
done:
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
||||
|
|
@ -2921,6 +2926,8 @@ static int do_set_stream_mute(struct client *client, uint32_t command, uint32_t
|
|||
if (stream != NULL) {
|
||||
float val;
|
||||
|
||||
if (stream->muted == mute) goto done;
|
||||
|
||||
stream->muted = mute;
|
||||
stream->muted_set = true;
|
||||
|
||||
|
|
@ -2947,6 +2954,7 @@ static int do_set_stream_mute(struct client *client, uint32_t command, uint32_t
|
|||
if ((res = set_node_volume_mute(o, NULL, &mute)) < 0)
|
||||
return res;
|
||||
}
|
||||
done:
|
||||
return reply_simple_ack(client, tag);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue