Code: Select all
Debug OpenLibrary(#PB_Any, "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib")
Any hints?
https://download.videolan.org/pub/videolan/vlc/
Code: Select all
Debug OpenLibrary(#PB_Any, "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib")
Code: Select all
SetEnvironmentVariable("VLC_PLUGIN_PATH", "/Applications/VLC.app/Contents/MacOS/plugins/")
Yes. I set this. But the problem is the OpenLibrary command. It seems the library can not be opened.Justin wrote:Have you tried this?With the correct path.Code: Select all
SetEnvironmentVariable("VLC_PLUGIN_PATH", "/Applications/VLC.app/Contents/MacOS/plugins/")
The VLC distribution has changed the way it packages its dylibs, which affects the ability for the VLC plugin to load them.
`otool -L` output from VLC 2.2.8:
```
/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib:
@rpath/libvlc.dylib (compatibility version 12.0.0, current version 12.0.0)
@rpath/libvlccore.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
```
`otool -L` output from VLC 3.0.0:
```
/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib:
@loader_path/lib/libvlc.5.dylib (compatibility version 11.0.0, current version 11.1.0)
@loader_path/../lib/libvlccore.8.dylib (compatibility version 9.0.0, current version 9.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
```
The change from `@loader_path` to `@rpath` now puts the burden on consumers of `libvlc.5.dylib` (read: OBS’ VLC plugin) to have set the `@rpath` (at compile time) to include the path to that dylib. VLC itself sets the `@rpath` appropriately from within the VLC application binary itself. This is possible because all the libraries are accessible relative to that binary.
Code: Select all
Debug OpenLibrary(#PB_Any, "/Applications/VLC.app/Contents/MacOS/lib/libvlc.5.dylib") # = 4296235608
Debug OpenLibrary(#PB_Any, "/Applications/VLC3.app/Contents/MacOS/lib/libvlc.5.dylib") # = 0
Code: Select all
EnableExplicit
Define.s libVlc
Define.i hlib
libVlc = "yourpath/lib/libvlc.dylib"
SetEnvironmentVariable("VLC_PLUGIN_PATH", "yourpath/plugins/")
hlib = OpenLibrary(#PB_Any, libVlc)
Debug CallFunction(hlib, "libvlc_new", 0, #Null)
Code: Select all
EnableExplicit
Define.s libVlc
Define.i hlib
libVlc = GetUserDirectory(#PB_Directory_Documents) + "VlcTRY/VLC.app/Contents/MacOS/lib/libvlc.dylib"
SetEnvironmentVariable("VLC_PLUGIN_PATH", GetUserDirectory(#PB_Directory_Documents) + "VlcTRY/VLC.app/Contents/MacOS//plugins/")
hlib = OpenLibrary(#PB_Any, libVlc)
Debug CallFunction(hlib, "libvlc_new", 0, #Null)