diff --git a/INSTALL.md b/INSTALL.md index 19bb8fc0d..89ff740af 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -288,6 +288,7 @@ In addition to these, you need to create a `plugins` directory and copy over the ``` libaudio_format_plugin.dylib +libauhal_plugin.dylib libavcodec_plugin.dylib libconsole_logger_plugin.dylib libfilesystem_plugin.dylib diff --git a/es-core/src/components/VideoVlcComponent.cpp b/es-core/src/components/VideoVlcComponent.cpp index aab682e93..ff7bcb4c5 100644 --- a/es-core/src/components/VideoVlcComponent.cpp +++ b/es-core/src/components/VideoVlcComponent.cpp @@ -12,7 +12,11 @@ #include "PowerSaver.h" #include "Settings.h" -#if defined(__linux__) || defined(_WIN64) +#if defined(__APPLE__) +#include "utils/FileSystemUtil.h" +#endif + +#if defined(__linux__) || defined(_WIN64) || defined(__APPLE__) #include #include #else @@ -22,7 +26,7 @@ #include -#ifdef _WIN64 +#if defined(_WIN64) #include #include #endif @@ -218,6 +222,17 @@ void VideoVlcComponent::setupVLC(std::string subtitles) argslen = sizeof(singleargs) / sizeof(singleargs[0]); args = singleargs; } + + #if defined(__APPLE__) + // It's required to set the VLC_PLUGIN_PATH variable on macOS, or the libVLC + // initialization will fail (with no error message). + std::string vlcPluginPath = Utils::FileSystem::getExePath() + "/plugins"; + if (Utils::FileSystem::isDirectory(vlcPluginPath)) + setenv("VLC_PLUGIN_PATH", vlcPluginPath.c_str(), 1); + else + setenv("VLC_PLUGIN_PATH", "/Applications/VLC.app/Contents/MacOS/plugins/", 1); + #endif + mVLC = libvlc_new(argslen, args); } }