From 2e1eaaec5e450b9fec035449958ecfef4302f720 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 8 Mar 2024 20:56:46 +0900 Subject: [PATCH] ges: Fix critical warning GStreamer-CRITICAL **: 20:44:38.256: gst_debug_log_full_valist: assertion 'category != NULL' failed Make sure debug category initialized. Part-of: --- .../gst-editing-services/ges/ges-asset.c | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/subprojects/gst-editing-services/ges/ges-asset.c b/subprojects/gst-editing-services/ges/ges-asset.c index e2419c3b9e..1a9b2a33b0 100644 --- a/subprojects/gst-editing-services/ges/ges-asset.c +++ b/subprojects/gst-editing-services/ges/ges-asset.c @@ -129,9 +129,24 @@ #include -GST_DEBUG_CATEGORY_STATIC (ges_asset_debug); #undef GST_CAT_DEFAULT -#define GST_CAT_DEFAULT ges_asset_debug + +#ifndef GST_DISABLE_GST_DEBUG +#define GST_CAT_DEFAULT ensure_debug_category() +static GstDebugCategory * +ensure_debug_category (void) +{ + static gsize cat_gonce = 0; + + if (g_once_init_enter (&cat_gonce)) { + gsize cat_done = (gsize) _gst_debug_category_new ("ges-asset", + GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GES Asset"); + g_once_init_leave (&cat_gonce, cat_done); + } + + return (GstDebugCategory *) cat_gonce; +} +#endif /* GST_DISABLE_GST_DEBUG */ enum { @@ -538,9 +553,6 @@ ges_asset_class_init (GESAssetClass * klass) klass->extract = ges_asset_extract_default; klass->request_id_update = ges_asset_request_id_update_default; klass->inform_proxy = NULL; - - GST_DEBUG_CATEGORY_INIT (ges_asset_debug, "ges-asset", - GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GES Asset"); } void