mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
stream: improve control update
When setting the volume, update the stream controls with the new values and update the internal state with the control_info event.
This commit is contained in:
parent
69ad904b63
commit
d5b13a1de2
2 changed files with 22 additions and 9 deletions
|
|
@ -275,17 +275,10 @@ static void set_stream_volume(pa_context *c, pa_stream *s, const pa_cvolume *vol
|
|||
if (n_channel_volumes != s->n_channel_volumes ||
|
||||
!memcmp(s->channel_volumes, vols, n_channel_volumes * sizeof(float)) ||
|
||||
s->mute != mute) {
|
||||
float val;
|
||||
|
||||
memcpy(s->channel_volumes, vols, n_channel_volumes * sizeof(float));
|
||||
s->n_channel_volumes = n_channel_volumes;
|
||||
s->mute = mute;
|
||||
|
||||
val = s->mute ? 1.0f : 0.0f;
|
||||
|
||||
float val = s->mute ? 1.0f : 0.0f;
|
||||
pw_stream_set_control(s->stream,
|
||||
SPA_PROP_mute, 1, &val,
|
||||
SPA_PROP_channelVolumes, n_channel_volumes, channel_volumes,
|
||||
SPA_PROP_channelVolumes, n_channel_volumes, vols,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue