Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 1 | From fd8f49dba8c09d47425da80f5faab3bfa4a7c962 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jose Quaresma <quaresma.jose@gmail.com> |
| 3 | Date: Sat, 10 Oct 2020 19:09:03 +0000 |
| 4 | Subject: [PATCH 1/3] gstpluginloader: when env var is set do not fall through |
| 5 | to system plugin scanner |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 6 | |
| 7 | If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that. |
| 8 | |
| 9 | Falling through to the one installed on the system is problamatic in cross-compilation |
| 10 | environemnts, regardless of whether one pointed to by the env var succeeded or failed. |
| 11 | |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 12 | taken from: |
| 13 | 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 |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 14 | |
| 15 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/669] |
| 16 | Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | --- |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 18 | gst/gstpluginloader.c | 15 +++++++-------- |
| 19 | 1 file changed, 7 insertions(+), 8 deletions(-) |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | |
| 21 | diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 22 | index d1e404d98..c626bf263 100644 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 23 | --- a/gst/gstpluginloader.c |
| 24 | +++ b/gst/gstpluginloader.c |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 25 | @@ -464,20 +464,19 @@ gst_plugin_loader_spawn (GstPluginLoader * loader) |
| 26 | if (loader->child_running) |
| 27 | return TRUE; |
| 28 | |
| 29 | - /* Find the gst-plugin-scanner: first try the env-var if it is set, |
| 30 | - * otherwise use the installed version */ |
| 31 | + /* Find the gst-plugin-scanner */ |
| 32 | env = g_getenv ("GST_PLUGIN_SCANNER_1_0"); |
| 33 | if (env == NULL) |
| 34 | env = g_getenv ("GST_PLUGIN_SCANNER"); |
| 35 | |
| 36 | if (env != NULL && *env != '\0') { |
| 37 | + /* use the env-var if it is set */ |
| 38 | GST_LOG ("Trying GST_PLUGIN_SCANNER env var: %s", env); |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 39 | helper_bin = g_strdup (env); |
| 40 | res = gst_plugin_loader_try_helper (loader, helper_bin); |
| 41 | g_free (helper_bin); |
| 42 | - } |
| 43 | - |
| 44 | - if (!res) { |
| 45 | + } else { |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 46 | + /* use the installed version */ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 47 | GST_LOG ("Trying installed plugin scanner"); |
| 48 | |
| 49 | #ifdef G_OS_WIN32 |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 50 | @@ -497,10 +496,10 @@ gst_plugin_loader_spawn (GstPluginLoader * loader) |
| 51 | #endif |
| 52 | res = gst_plugin_loader_try_helper (loader, helper_bin); |
| 53 | g_free (helper_bin); |
| 54 | + } |
| 55 | |
| 56 | - if (!res) { |
| 57 | - GST_INFO ("No gst-plugin-scanner available, or not working"); |
| 58 | - } |
| 59 | + if (!res) { |
| 60 | + GST_INFO ("No gst-plugin-scanner available, or not working"); |
| 61 | } |
| 62 | |
| 63 | return loader->child_running; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | -- |
Andrew Geissler | c723b72 | 2021-01-08 16:14:09 -0600 | [diff] [blame^] | 65 | 2.29.2 |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 66 | |