From d49ab88e663e8aa715b0f3b84baab8384e1a7faa Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Tue, 21 Apr 2026 19:10:50 +0000 Subject: [PATCH] desktop: fix Windows per-app volume reset on video playback (#6852) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VideoPlayer's mediaPlayerReady listener called mediaPlayer.audio().setVolume(100) on every freshly created VLC player. On Windows, VLCJ routes setVolume through WASAPI's ISimpleAudioVolume, which is the per-app entry in the Windows Volume Mixer — so every video playback snapped SimpleX Chat's mixer volume back to 100%, overriding the user's own setting. The call was also redundant: VLCJ's default volume for a new MediaPlayer is already 100, and the only path that previously used setVolume (enableSound) has been disabled since VLCJ issue #985 ("Impossible to change volume for only one player. It changes for every player."). Dropping the setVolume(100) line fixes the Windows regression without changing playback loudness on any platform. AudioPlayer / SoundPlayer / CallSoundsPlayer use a singleton VLC player and never called setVolume, so voice messages and ringtones are unaffected. Co-authored-by: Evgeny Poberezkin --- .../chat/simplex/common/platform/VideoPlayer.desktop.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt index c5a38ec4a1..f88c539284 100644 --- a/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt +++ b/apps/multiplatform/common/src/desktopMain/kotlin/chat/simplex/common/platform/VideoPlayer.desktop.kt @@ -265,7 +265,9 @@ actual class VideoPlayer actual constructor( mediaPlayer().events().addMediaPlayerEventListener(object: MediaPlayerEventAdapter() { override fun mediaPlayerReady(mediaPlayer: MediaPlayer?) { playerThread.execute { - mediaPlayer?.audio()?.setVolume(100) + // Do not call setVolume here: on Windows VLCJ routes it through WASAPI ISimpleAudioVolume, + // which resets SimpleX Chat's per-app volume in the Windows Volume Mixer on every playback + // (VLCJ issue #985). A fresh VLCJ MediaPlayer already defaults to volume 100, so this was redundant. mediaPlayer?.audio()?.isMute = false } }