Skip to content

Unsafe VLC options are not taken into account when injected by a lua script

Description

The PlaylistManager works with a list of MediaWrapper. This object can be initialized with a IMedia object returned by libvlc. But in this case, only the IMedia uri is used to generate MediaWrapper.mrl. The media itself is then discarded and any option set to it is lost.

It leads to issues when the media also has unsafe options set by, for example, a lua script. Example: youtube.lua tries to add :no-http-forward-cookies.

As the options for a media cannot be retrieved by design by the VLC API, we cannot make it work without changing the PlaylistManager logic. We could fix that in two ways:

  1. The MediaWrapper could directly embed the IMedia instance and keep it while it's needed. It would probably:
  • be hard to manage the IMedia lifecycle
  • lead to an increased memory use as the MediaWrapper object is used everywhere in the app
  1. Instead of using a MediaWrapper list, we could use a IMedia list in PlaylistManager. Probably the easiest and cleanest solution for me. But it's opened to discussion