gstpluginloader: when env var is set do not fall through to system plugin scanner

If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that.

Falling through to the one installed on the system is problamatic in cross-compilation
environemnts, regardless of whether one pointed to by the env var succeeded or failed.

taken from:
http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch?id=0db7ba34ca41b107042306d13a6f0162885c123b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/669>
This commit is contained in:
Jose Quaresma 2020-10-10 19:09:03 +00:00 committed by GStreamer Marge Bot
parent 10b38146e8
commit 9f95805869

View file

@ -464,20 +464,19 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
if (loader->child_running) if (loader->child_running)
return TRUE; return TRUE;
/* Find the gst-plugin-scanner: first try the env-var if it is set, /* Find the gst-plugin-scanner */
* otherwise use the installed version */
env = g_getenv ("GST_PLUGIN_SCANNER_1_0"); env = g_getenv ("GST_PLUGIN_SCANNER_1_0");
if (env == NULL) if (env == NULL)
env = g_getenv ("GST_PLUGIN_SCANNER"); env = g_getenv ("GST_PLUGIN_SCANNER");
if (env != NULL && *env != '\0') { if (env != NULL && *env != '\0') {
/* use the env-var if it is set */
GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env); GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env);
helper_bin = g_strdup (env); helper_bin = g_strdup (env);
res = gst_plugin_loader_try_helper (loader, helper_bin); res = gst_plugin_loader_try_helper (loader, helper_bin);
g_free (helper_bin); g_free (helper_bin);
} } else {
/* use the installed version */
if (!res) {
GST_LOG ("Trying installed plugin scanner"); GST_LOG ("Trying installed plugin scanner");
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
@ -497,11 +496,11 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
#endif #endif
res = gst_plugin_loader_try_helper (loader, helper_bin); res = gst_plugin_loader_try_helper (loader, helper_bin);
g_free (helper_bin); g_free (helper_bin);
}
if (!res) { if (!res) {
GST_INFO ("No gst-plugin-scanner available, or not working"); GST_INFO ("No gst-plugin-scanner available, or not working");
} }
}
return loader->child_running; return loader->child_running;
} }