Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gstreamer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-06-23 01:13:53 +0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-21 13:18:59 +0300
commitf83bf11d751125b87915c24f565987e904b27ebb (patch)
tree60f456dff5f88f4c473496ce7a42fbf63272e574
parent6b8bb822e469f4201dc23c59875f926aad2798af (diff)
registry: Use a toolchain-specific registry file on Windows
If we load a plugin registry for MinGW plugins when running with MSVC, we will have to write out the whole cache again, and vice-versa. Just use separate cache files so that the cache is actually useful. Closes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/427 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/636>
-rw-r--r--gst/gstregistry.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gst/gstregistry.c b/gst/gstregistry.c
index a8b2f51ca7..eb9958a2fe 100644
--- a/gst/gstregistry.c
+++ b/gst/gstregistry.c
@@ -122,6 +122,19 @@
extern HMODULE _priv_gst_dll_handle;
#endif
+/* Use a toolchain-dependent suffix on Windows */
+#ifdef G_OS_WIN32
+# ifdef _MSC_VER
+# define GST_REGISTRY_FILE_SUFFIX TARGET_CPU "-msvc"
+# else
+# define GST_REGISTRY_FILE_SUFFIX TARGET_CPU "-mingw"
+# endif
+#else
+# define GST_REGISTRY_FILE_SUFFIX TARGET_CPU
+#endif
+#define GST_REGISTRY_FILE_NAME "registry." GST_REGISTRY_FILE_SUFFIX ".bin"
+
+
#define GST_CAT_DEFAULT GST_CAT_REGISTRY
struct _GstRegistryPrivate
@@ -1713,7 +1726,7 @@ ensure_current_registry (GError ** error)
registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
if (registry_file == NULL) {
registry_file = g_build_filename (g_get_user_cache_dir (),
- "gstreamer-" GST_API_VERSION, "registry." TARGET_CPU ".bin", NULL);
+ "gstreamer-" GST_API_VERSION, GST_REGISTRY_FILE_NAME, NULL);
}
if (!_gst_disable_registry_cache) {