mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-20 17:51:38 +00:00
desktop: fix Windows per-app volume reset on video playback (#6852)
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 <evgeny@poberezkin.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
parent
614730abd8
commit
d49ab88e66
+3
-1
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user