Skip to content

fix(viewer): pre-parse media to reduce VLC playback startup gap#2736

Merged
nicomiguelino merged 2 commits intoScreenly:masterfrom
nicomiguelino:fix/reduce-video-transition-gap-vlc
Apr 14, 2026
Merged

fix(viewer): pre-parse media to reduce VLC playback startup gap#2736
nicomiguelino merged 2 commits intoScreenly:masterfrom
nicomiguelino:fix/reduce-video-transition-gap-vlc

Conversation

@nicomiguelino
Copy link
Copy Markdown
Contributor

@nicomiguelino nicomiguelino commented Apr 14, 2026

Issues Fixed

Description

Calls get_media().parse() in VLCMediaPlayer.set_asset() to pre-load file metadata before play() is invoked. This gives VLC a head start on opening the file and reading codec info, reducing the startup delay that causes the visible blank screen between slides.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

- Call `get_media().parse()` in `VLCMediaPlayer.set_asset()` to pre-load
  file metadata before `play()` is called
@nicomiguelino nicomiguelino self-assigned this Apr 14, 2026
@nicomiguelino nicomiguelino marked this pull request as ready for review April 14, 2026 05:49
@nicomiguelino nicomiguelino requested a review from a team as a code owner April 14, 2026 05:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce the visible blank gap when transitioning into VLC-played videos (notably on Raspberry Pi 1–4) by pre-parsing VLC media metadata during VLCMediaPlayer.set_asset() before play() is invoked.

Changes:

  • Pre-parse the current VLC media (get_media().parse()) immediately after set_mrl() and audio device selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread viewer/media_player.py
Comment thread viewer/media_player.py
- Add `TestVLCMediaPlayer` class with shared patch setup in `setUp`/`tearDown`
- Assert that `get_media().parse()` is called on `set_asset()`
@sonarqubecloud
Copy link
Copy Markdown

@nicomiguelino nicomiguelino marked this pull request as ready for review April 14, 2026 14:00
@nicomiguelino nicomiguelino merged commit 726cb37 into Screenly:master Apr 14, 2026
8 checks passed
@nicomiguelino nicomiguelino deleted the fix/reduce-video-transition-gap-vlc branch April 14, 2026 14:01
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.

2 participants