From deba492a2d1f2fef6f8ff4ea90ca6b479a1e01a5 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 27 Aug 2018 19:36:39 -0700 Subject: [PATCH] libobs: Blacklist old obs-browser version on macOS On macOS, the older version of the browser plugin used to reside in a different directory. This would cause two versions of obs-browser to load if you installed the new version of OBS over the old version of OBS. This fixes that bug with an slightly unsightly hack by blacklisting that older module if it tries to load an obs-module that resides in that specific older directory. --- libobs/obs-module.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libobs/obs-module.c b/libobs/obs-module.c index e07f016dc..41369659c 100644 --- a/libobs/obs-module.c +++ b/libobs/obs-module.c @@ -85,6 +85,17 @@ int obs_open_module(obs_module_t **module, const char *path, if (!module || !path || !obs) return MODULE_ERROR; +#ifdef __APPLE__ + /* HACK: Do not load obsolete obs-browser build on macOS; the + * obs-browser plugin used to live in the Application Support + * directory. */ + if (astrstri(path, "Library/Application Support") != NULL && + astrstri(path, "obs-browser") != NULL) { + blog(LOG_WARNING, "Ignoring old obs-browser.so version"); + return MODULE_ERROR; + } +#endif + blog(LOG_DEBUG, "---------------------------------"); mod.module = os_dlopen(path);