From 6d06320fb224e3f7e9f9ff2d727007225ab92867 Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sat, 9 Apr 2022 02:12:17 -0400 Subject: [PATCH] [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 --- client/audiodevs/PipeWire/pipewire.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/audiodevs/PipeWire/pipewire.c b/client/audiodevs/PipeWire/pipewire.c index fabb26d3..900439ae 100644 --- a/client/audiodevs/PipeWire/pipewire.c +++ b/client/audiodevs/PipeWire/pipewire.c @@ -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); }