summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2017-09-27 20:29:06 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2017-09-27 20:59:54 +0200
commit2138acabe5bf7f55ee23edab116fc1c1239cb604 (patch)
tree19a831a4a2c5ec2e11146d6ce1a4ddbc545f11f9
parent895bb7bcd627989951d2041aefba73bb4b59bad5 (diff)
gst: Modify behaviour of gst_get_main_executable_path
To actually return the path of the executable, not its directory. https://bugzilla.gnome.org/show_bug.cgi?id=788256
-rw-r--r--gst/gst.c10
-rw-r--r--gst/gstplugin.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/gst/gst.c b/gst/gst.c
index 9642ed7e3..805dd7dce 100644
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -324,17 +324,13 @@ static void
find_executable_path (void)
{
GError *error = NULL;
- gchar *path;
if (_gst_executable_path)
return;
- path = g_file_read_link ("/proc/self/exe", &error);
-
- if (path) {
- _gst_executable_path = g_path_get_dirname (path);
- g_free (path);
- }
+ _gst_executable_path = g_file_read_link ("/proc/self/exe", &error);
+ if (error)
+ g_error_free (error);
}
#elif defined(G_OS_WIN32)
static void
diff --git a/gst/gstplugin.c b/gst/gstplugin.c
index 18183c3a3..df47e47c9 100644
--- a/gst/gstplugin.c
+++ b/gst/gstplugin.c
@@ -1724,13 +1724,17 @@ gst_plugin_ext_dep_get_stat_hash (GstPlugin * plugin, GstPluginDep * dep)
gchar *full_path;
if (paths_are_relative_to_exe && !g_path_is_absolute (path)) {
+ gchar *appdir;
+
if (!_gst_executable_path) {
GST_FIXME_OBJECT (plugin,
"Path dependency %s relative to executable path but could not retrieve executable path",
path);
continue;
}
- full_path = g_build_filename (_gst_executable_path, path, NULL);
+ appdir = g_path_get_dirname (_gst_executable_path);
+ full_path = g_build_filename (appdir, path, NULL);
+ g_free (appdir);
} else {
full_path = g_strdup (path);
}