[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.

6ad6300ec6/src/pipewire/stream.c (L2063)
This commit is contained in:
Babbaj 2022-04-09 02:12:17 -04:00 committed by Geoffrey McRae
parent f3fe774f69
commit 6d06320fb2

View File

@ -358,7 +358,8 @@ static void pipewire_playbackVolume(int channels, const uint16_t volume[])
static void pipewire_playbackMute(bool mute) static void pipewire_playbackMute(bool mute)
{ {
pw_thread_loop_lock(pw.thread); 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); 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) static void pipewire_recordMute(bool mute)
{ {
pw_thread_loop_lock(pw.thread); 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); pw_thread_loop_unlock(pw.thread);
} }