Skip to content

Plugin path on Windows seems not the be followed

I set the paths

J:\Coding_Stuff\vlc-rs>set VLC_PLUGINS_PATH=J:\Coding_Stuff\vlc\plugins
J:\Coding_Stuff\vlc-rs>echo %VLC_PLUGINS_PATH%
J:\Coding_Stuff\vlc\plugins

J:\Coding_Stuff\vlc-rs>set VLC_LIB_DIR=J:\Coding_Stuff\vlc
J:\Coding_Stuff\vlc-rs>echo %VLC_LIB_DIR%      
J:\Coding_Stuff\vlc

I then try to build the project with the cli_player example

J:\Coding_Stuff\vlc-rs>cargo build --example cli_player

Now, it crashed if it tries to execute the binary. Due to not having any of the DLL in the folder with the binary. (Even tho they all exist the the given VLC_LIB_DIR environment)

So I copy over the DLLs. This time it crashes on any call vlc binding function, with:

J:\Coding_Stuff\vlc-rs>.\target\debug\examples\cli_player.exe
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', examples\cli_player.rs:20:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After a lot of debugging, it was because the plugins folder was not in the same spot as the executable. Once that got moved over I am able to run

J:\Coding_Stuff\vlc-rs>.\target\debug\examples\cli_player.exe movie.mp4

Now it succeeds.

An additional very related problem is that even after moving the plugins folder, if you try to run the binary using cargo, you get the same error as if the plugins folder does not exist

   Compiling vlc-rs v0.3.0 (J:\Coding_Stuff\vlc-rs)
    Finished dev [unoptimized + debuginfo] target(s) in 0.85s
     Running `target\debug\examples\cli_player.exe movie.mp4`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', examples\cli_player.rs:20:36
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\examples\cli_player.exe movie.mp4` (exit code: 101)