Skip to content

VLC backend: mute a player by opening its media without audio - #372

Open
youms wants to merge 1 commit into
Cimbali:mainfrom
youms:fix/vlc-mute-noaudio
Open

youms wants to merge 1 commit into
Cimbali:mainfrom
youms:fix/vlc-mute-noaudio

Conversation

@youms

@youms youms commented Oct 28, 2026 •

Copy link
Copy Markdown

Refs #364.

On Windows, libVLC's volume is the volume of the process's audio session, the entry in the Windows volume mixer that Windows remembers across runs. Every Pympress player shares it, so muting the presenter's copy of a video through audio_set_volume(0) also mutes the content window's, and the other way round.

A muted player now opens its media with VLC's :no-audio option, so it has no audio track and the shared volume is left alone. mute() records the state and reopens the media, unless the player is playing, in which case it applies from the next start.

Changes media_overlays/vlc_backend.py only.

This applies to main as it is today. It edits lines that #369 (for #363) and #371 (for #367) also touch, so whichever of those merges first, I will rebase this one. I tested it on top of #363 and #367, since I expect those two to land first. The deck is 1080p with stereo AAC audio on slide 7. I visited slide 7 twice and read the libVLC console (--verbose=2):

  • Without this commit: 4 audio decoders created, and no audio is disabled, not selecting ES line.
  • With this commit: 2 audio decoders created (one per visit, in the presenter's player), and 2 audio is disabled, not selecting ES lines (the content window's player, one per visit).
  • With the python.exe volume set to 100 in the mixer, the music played on the laptop speakers.

Not tested: the GStreamer backend (unchanged), other platforms, muting while a clip is already playing (applies from the next start, as described).

libVLC's volume is shared by all players of the process on Windows, so muting through the volume muted or unmuted every copy. Refs Cimbali#364.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant