[client] audio/pw: fix muting
Pipewire documents the mute parameter as a bool, however `pw_stream_set_control` expects a float value and converts it to a bool. https://gitlab.freedesktop.org/pipewire/pipewire/-/blob/6ad6300ec657c88322a8cd6f3548261d3dc05359/src/pipewire/stream.c#L2063
This commit is contained in:
1 parent
f3fe774f69
commit
6d06320fb2
1 file changed
+4
-2
@@ -358,7 +358,8 @@ static void pipewire_playbackVolume(int channels, const uint16_t volume[])
|
||||
static void pipewire_playbackMute(bool mute)
|
||||
{
|
||||
pw_thread_loop_lock(pw.thread);
|
||||
pw_stream_set_control(pw.playback.stream, SPA_PROP_mute, 1, (void *)&mute, 0);
|
||||
float val = mute ? 1.0f : 0.0f;
|
||||
pw_stream_set_control(pw.playback.stream, SPA_PROP_mute, 1, &val, 0);
|
||||
pw_thread_loop_unlock(pw.thread);
|
||||
}
|
||||
|
||||
@@ -515,7 +516,8 @@ static void pipewire_recordVolume(int channels, const uint16_t volume[])
|
||||
static void pipewire_recordMute(bool mute)
|
||||
{
|
||||
pw_thread_loop_lock(pw.thread);
|
||||
pw_stream_set_control(pw.record.stream, SPA_PROP_mute, 1, (void *)&mute, 0);
|
||||
float val = mute ? 1.0f : 0.0f;
|
||||
pw_stream_set_control(pw.record.stream, SPA_PROP_mute, 1, &val, 0);
|
||||
pw_thread_loop_unlock(pw.thread);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user