Skip to content

If a Video Finishes Playing, Future Videos are Letterboxed

Summary

If I let a video finish playing, the MediaPlayer will letterbox the next video I play into a buffer the size of the video that finished.

Minimal project and steps to reproduce

  1. Clone this repo: https://gitlab.com/brisingre/vlc-unity-bugs
  2. Import VLC Unity
  3. Open the "115 Buffer Size Gets Stuck" scene
  4. Press play and watch the bug happen

What is the current bug behavior?

If a video finishes, all future videos will be letterboxed into a buffer the size of that video.

What is the expected correct behavior?

Playing a new video after a video finishes should resize that buffer, as it does when you play the first video on a new MediaPlayer, or play a new video before the currently-playing video finishes.

Does it work on other plaforms? Does it work with the official VLC apps?

Right now VLC for Unity only supports one platform. I have never noticed VLC struggling with this.

Environment

  • OS: Windows
  • Version 10 LTSC
  • Device: PC
  • LibVLC version and architecture 4.0.0 x64
  • LibVLCSharp version Not quite sure how to check this, sorry.
  • VLC Unity plugin version 0.1.3
  • Scripting backend used Mono

Possible fixes

An easy workaround in Unity is to create a new MediaPlayer object whenever you play a new video. But that shouldn't be required.

My best guess is that there's some kind of pointer that's getting dropped with a video ends, that whatever resizes the internal texture of a MediaPlayer needs. Once a video ends and that pointer gets dropped, that resize function never works again. But I don't know anything about the LibVLC Unity code yet, so I'm not sure where to look for this function.

Edited by LL