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