summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-20 09:45:06 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-01-20 09:48:27 +0000
commit89676040530f5336ff157598870bfaff0d7d4aad (patch)
tree5db90de39b8104e07d097788ced80eeccf6a53a6
parentf137d188cb642094bcd21de75e0856907b99dc22 (diff)
pluginloader: try scanner set via env var before using the installed one
If the GST_PLUGIN_SCANNER environment variable is set, we should try the scanner specified there first, to make sure the right scanner binary is used for uninstalled setups and builds from source when there's already an installed version.
-rw-r--r--gst/gstpluginloader.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
index b987c89942..3b87736c80 100644
--- a/gst/gstpluginloader.c
+++ b/gst/gstpluginloader.c
@@ -376,29 +376,32 @@ gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
static gboolean
gst_plugin_loader_spawn (GstPluginLoader * loader)
{
+ const gchar *env;
char *helper_bin;
- gboolean res;
+ gboolean res = FALSE;
if (loader->child_running)
return TRUE;
- /* Find the gst-plugin-scanner, first try installed then by env-var */
- helper_bin = g_strdup (GST_PLUGIN_SCANNER_INSTALLED);
- res = gst_plugin_loader_try_helper (loader, helper_bin);
- g_free (helper_bin);
+ /* Find the gst-plugin-scanner: first try the env-var if it is set,
+ * otherwise use the installed version */
+ env = g_getenv ("GST_PLUGIN_SCANNER");
+
+ if (env != NULL && *env != '\0') {
+ GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env);
+ helper_bin = g_strdup (env);
+ res = gst_plugin_loader_try_helper (loader, helper_bin);
+ g_free (helper_bin);
+ }
if (!res) {
- /* Try the GST_PLUGIN_SCANNER env var */
- const gchar *env = g_getenv ("GST_PLUGIN_SCANNER");
- if (env != NULL) {
- GST_LOG ("Installed plugin scanner failed. "
- "Trying GST_PLUGIN_SCANNER env var: %s", env);
- helper_bin = g_strdup (env);
- res = gst_plugin_loader_try_helper (loader, helper_bin);
- g_free (helper_bin);
- } else {
- GST_LOG ("Installed plugin scanner failed and GST_PLUGIN_SCANNER "
- " env var not set. No gst-plugin-scanner available");
+ GST_LOG ("Trying installed plugin scanner");
+ helper_bin = g_strdup (GST_PLUGIN_SCANNER_INSTALLED);
+ res = gst_plugin_loader_try_helper (loader, helper_bin);
+ g_free (helper_bin);
+
+ if (!res) {
+ GST_INFO ("No gst-plugin-scanner available, or not working");
}
}