Skip to content

VLC backend on Windows: no flash when a video slide opens or closes - #369

Open
youms wants to merge 2 commits into
Cimbali:mainfrom
youms:fix/vlc-no-flash
Open

youms wants to merge 2 commits into
Cimbali:mainfrom
youms:fix/vlc-no-flash

Conversation

@youms

@youms youms commented Oct 28, 2026

Copy link
Copy Markdown

Refs #363.

With the VLC backend on Windows, changing into or out of a video slide shows the desktop, black or white in the slide area for 100 to 250 ms. VLC's video window is empty until it presents its first frame, and GTK does not repaint the slide under a mapped native child window when the movie zone is removed.

This changes media_overlays/vlc_backend.py only.

  • The movie zone stays child-invisible from embedding until VLC reports its first frame (MediaPlayerTimeChanged). It is then shown 30 ms later from the main thread, with a 1.5 s fallback. In between, the slide stays visible, and its first frame matches the video.
  • When a video closes, the zone is made child-invisible first, the parent window is repainted at once, and the player and overlay are removed 150 ms later.
  • VLC calls its event handlers from its own threads. The handlers that touched GTK (the progress bar, the end of the stream) now go through GLib.idle_add, because GTK is not thread-safe.
  • The new behaviour is enabled only on Windows (HIDE_UNTIL_FIRST_FRAME = IS_WINDOWS), because I could not test other platforms.

Tested on Windows 11, MSYS2 UCRT64, Python 3.14.9, GTK 3.24.52, VLC 3.0.24, Intel UHD 620. I built this branch and origin/main (3750003) each as its own package and ran the real app on a 1080p deck with five 60 fps video slides. Each run is 7 slide changes (picture to video, video to video forward and backward, video to picture). I captured the content window and compared every frame with the slide before and the frames of the clip. Flash is the time spent on frames that match neither.

  • origin/main, content window fullscreen: 156 to 272 ms of flash on all 7 changes, black up to 77 ms.
  • origin/main, windowed: 112 to 323 ms of flash on 6 changes. The first change of that run is left out because the display was waking from standby during it.
  • This branch, windowed and fullscreen: 0 ms of flash and 0 ms of black on all 14 changes.
  • The console output of the Pympress process was empty. The log had one warning (the screensaver inhibit call failing), the same as on origin/main.

One run per configuration. Not tested: Linux and macOS (the new code is off there), other VLC versions.

youms added 2 commits October 28, 2026 14:15
On Windows the slide area briefly showed the desktop, black or white when a video slide opened or closed, and the progress bar was updated from VLC threads. Refs Cimbali#363.
Show the movie zone only once VLC has produced its first frame, instead of after a fixed delay. Refs Cimbali#363.

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