mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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
This commit is contained in:
parent
895bb7bcd6
commit
2138acabe5
2 changed files with 8 additions and 8 deletions
10
gst/gst.c
10
gst/gst.c
|
@ -324,17 +324,13 @@ static void
|
||||||
find_executable_path (void)
|
find_executable_path (void)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gchar *path;
|
|
||||||
|
|
||||||
if (_gst_executable_path)
|
if (_gst_executable_path)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
path = g_file_read_link ("/proc/self/exe", &error);
|
_gst_executable_path = g_file_read_link ("/proc/self/exe", &error);
|
||||||
|
if (error)
|
||||||
if (path) {
|
g_error_free (error);
|
||||||
_gst_executable_path = g_path_get_dirname (path);
|
|
||||||
g_free (path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#elif defined(G_OS_WIN32)
|
#elif defined(G_OS_WIN32)
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -1724,13 +1724,17 @@ gst_plugin_ext_dep_get_stat_hash (GstPlugin * plugin, GstPluginDep * dep)
|
||||||
gchar *full_path;
|
gchar *full_path;
|
||||||
|
|
||||||
if (paths_are_relative_to_exe && !g_path_is_absolute (path)) {
|
if (paths_are_relative_to_exe && !g_path_is_absolute (path)) {
|
||||||
|
gchar *appdir;
|
||||||
|
|
||||||
if (!_gst_executable_path) {
|
if (!_gst_executable_path) {
|
||||||
GST_FIXME_OBJECT (plugin,
|
GST_FIXME_OBJECT (plugin,
|
||||||
"Path dependency %s relative to executable path but could not retrieve executable path",
|
"Path dependency %s relative to executable path but could not retrieve executable path",
|
||||||
path);
|
path);
|
||||||
continue;
|
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 {
|
} else {
|
||||||
full_path = g_strdup (path);
|
full_path = g_strdup (path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue