mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
Merge pull request #1356 from TheMuso/fix-vlc-plugin-on-mac
vlc-video: Dlopen libvlccore.dylib on mac OS
This commit is contained in:
commit
b00272210b
|
@ -57,6 +57,10 @@ LIBVLC_MEDIA_LIST_PLAYER_NEXT libvlc_media_list_player_next_;
|
||||||
LIBVLC_MEDIA_LIST_PLAYER_PREVIOUS libvlc_media_list_player_previous_;
|
LIBVLC_MEDIA_LIST_PLAYER_PREVIOUS libvlc_media_list_player_previous_;
|
||||||
|
|
||||||
void *libvlc_module = NULL;
|
void *libvlc_module = NULL;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
void *libvlc_core_module = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
libvlc_instance_t *libvlc = NULL;
|
libvlc_instance_t *libvlc = NULL;
|
||||||
uint64_t time_start = 0;
|
uint64_t time_start = 0;
|
||||||
|
|
||||||
|
@ -154,8 +158,14 @@ static bool load_libvlc_module(void)
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define LIBVLC_DIR "/Applications/VLC.app/Contents/MacOS/"
|
#define LIBVLC_DIR "/Applications/VLC.app/Contents/MacOS/"
|
||||||
|
/* According to otoolo -L, this is what libvlc.dylib wants. */
|
||||||
|
#define LIBVLC_CORE_FILE LIBVLC_DIR "lib/libvlccore.dylib"
|
||||||
#define LIBVLC_FILE LIBVLC_DIR "lib/libvlc.5.dylib"
|
#define LIBVLC_FILE LIBVLC_DIR "lib/libvlc.5.dylib"
|
||||||
setenv("VLC_PLUGIN_PATH", LIBVLC_DIR "plugins", false);
|
setenv("VLC_PLUGIN_PATH", LIBVLC_DIR "plugins", false);
|
||||||
|
libvlc_core_module = os_dlopen(LIBVLC_CORE_FILE);
|
||||||
|
|
||||||
|
if (!libvlc_core_module)
|
||||||
|
return false;
|
||||||
#else
|
#else
|
||||||
#define LIBVLC_FILE "libvlc.so.5"
|
#define LIBVLC_FILE "libvlc.so.5"
|
||||||
#endif
|
#endif
|
||||||
|
@ -204,6 +214,10 @@ void obs_module_unload(void)
|
||||||
{
|
{
|
||||||
if (libvlc)
|
if (libvlc)
|
||||||
libvlc_release_(libvlc);
|
libvlc_release_(libvlc);
|
||||||
|
#ifdef __APPLE__
|
||||||
|
if (libvlc_core_module)
|
||||||
|
os_dlclose(libvlc_core_module);
|
||||||
|
#endif
|
||||||
if (libvlc_module)
|
if (libvlc_module)
|
||||||
os_dlclose(libvlc_module);
|
os_dlclose(libvlc_module);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue