depot/third_party/nixpkgs/pkgs/development/libraries/mediastreamer/plugins_dir.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

18 lines
653 B
Diff

diff --git a/src/base/msfactory.c b/src/base/msfactory.c
index 14f868e3..2e3445a1 100644
--- a/src/base/msfactory.c
+++ b/src/base/msfactory.c
@@ -770,7 +770,12 @@ void ms_factory_uninit_plugins(MSFactory *factory){
}
void ms_factory_init_plugins(MSFactory *obj) {
- if (obj->plugins_dir == NULL) {
+ char *package_plugins_dir;
+ // Force plugin dir from environment variable if set
+ package_plugins_dir = getenv("MEDIASTREAMER_PLUGINS_DIR");
+ if (package_plugins_dir != NULL) {
+ ms_factory_set_plugins_dir(obj, package_plugins_dir);
+ } else if (obj->plugins_dir == NULL) {
#ifdef __APPLE__
char *dir = getPluginsDir();
if (dir != NULL) {