diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index 7d7b6fe0f1..be64cfddf4 100644 --- a/ext/directfb/dfbvideosink.c +++ b/ext/directfb/dfbvideosink.c @@ -383,8 +383,8 @@ gst_dfbvideosink_event_thread (GstDfbVideoSink * dfbvideosink) while (dfbvideosink->running) { /* Wait for an event with a 50 ms timeout */ - dfbvideosink->event_buffer->WaitForEventWithTimeout (dfbvideosink-> - event_buffer, 0, 50); + dfbvideosink->event_buffer-> + WaitForEventWithTimeout (dfbvideosink->event_buffer, 0, 50); /* Do we have an event ? */ ret = dfbvideosink->event_buffer->HasEvent (dfbvideosink->event_buffer); @@ -1898,13 +1898,15 @@ gst_meta_dfbsurface_get_info (void) { static const GstMetaInfo *meta_info = NULL; - if (meta_info == NULL) { - meta_info = gst_meta_register ("GstMetaDfbSurface", "GstMetaDfbSurface", + if (g_once_init_enter (&meta_info)) { + const GstMetaInfo *meta = + gst_meta_register ("GstMetaDfbSurface", "GstMetaDfbSurface", sizeof (GstMetaDfbSurface), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL, (GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL); + g_once_init_leave (&meta_info, meta); } return meta_info; } diff --git a/ext/wayland/waylandpool.c b/ext/wayland/waylandpool.c index dd12d10056..ca380ea55c 100644 --- a/ext/wayland/waylandpool.c +++ b/ext/wayland/waylandpool.c @@ -61,12 +61,13 @@ gst_wl_meta_get_info (void) { static const GstMetaInfo *wl_meta_info = NULL; - if (wl_meta_info == NULL) { - wl_meta_info = + if (g_once_init_enter (&wl_meta_info)) { + const GstMetaInfo *meta = gst_meta_register (GST_WL_META_API_TYPE, "GstWlMeta", sizeof (GstWlMeta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) gst_wl_meta_free, (GstMetaTransformFunction) NULL); + g_once_init_leave (&wl_meta_info, meta); } return wl_meta_info; } diff --git a/gst-libs/gst/video/gstsurfacemeta.c b/gst-libs/gst/video/gstsurfacemeta.c index 3ff9aec896..f534bc0c5e 100644 --- a/gst-libs/gst/video/gstsurfacemeta.c +++ b/gst-libs/gst/video/gstsurfacemeta.c @@ -62,11 +62,13 @@ gst_surface_meta_get_info (void) { static const GstMetaInfo *meta_info = NULL; - if (meta_info == NULL) { - meta_info = gst_meta_register (GST_SURFACE_META_API_TYPE, "GstSurfaceMeta", + if (g_once_init_enter (&meta_info)) { + const GstMetaInfo *meta = + gst_meta_register (GST_SURFACE_META_API_TYPE, "GstSurfaceMeta", sizeof (GstSurfaceMeta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL); + g_once_init_leave (&meta_info, meta); } return meta_info; } diff --git a/sys/applemedia/coremediabuffer.c b/sys/applemedia/coremediabuffer.c index 63ef6116b5..273d8ff645 100644 --- a/sys/applemedia/coremediabuffer.c +++ b/sys/applemedia/coremediabuffer.c @@ -49,12 +49,13 @@ gst_core_media_meta_get_info (void) { static const GstMetaInfo *core_media_meta_info = NULL; - if (core_media_meta_info == NULL) { - core_media_meta_info = gst_meta_register (GST_CORE_MEDIA_META_API_TYPE, + if (g_once_init_enter (&core_media_meta_info)) { + const GstMetaInfo *meta = gst_meta_register (GST_CORE_MEDIA_META_API_TYPE, "GstCoreMediaMeta", sizeof (GstCoreMediaMeta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) gst_core_media_meta_free, (GstMetaTransformFunction) NULL); + g_once_init_leave (&core_media_meta_info, meta); } return core_media_meta_info; } diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c index a45c3f61b2..c6580417cc 100644 --- a/sys/applemedia/corevideobuffer.c +++ b/sys/applemedia/corevideobuffer.c @@ -51,12 +51,13 @@ gst_core_video_meta_get_info (void) { static const GstMetaInfo *core_video_meta_info = NULL; - if (core_video_meta_info == NULL) { - core_video_meta_info = gst_meta_register (GST_CORE_VIDEO_META_API_TYPE, + if (g_once_init_enter (&core_video_meta_info)) { + const GstMetaInfo *meta = gst_meta_register (GST_CORE_VIDEO_META_API_TYPE, "GstCoreVideoMeta", sizeof (GstCoreVideoMeta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) gst_core_video_meta_free, (GstMetaTransformFunction) NULL); + g_once_init_leave (&core_video_meta_info, meta); } return core_video_meta_info; } diff --git a/sys/pvr2d/gstpvrbufferpool.c b/sys/pvr2d/gstpvrbufferpool.c index fdc68b9522..81106dc419 100644 --- a/sys/pvr2d/gstpvrbufferpool.c +++ b/sys/pvr2d/gstpvrbufferpool.c @@ -71,12 +71,13 @@ gst_pvr_meta_get_info (void) { static const GstMetaInfo *pvr_meta_info = NULL; - if (pvr_meta_info == NULL) { - pvr_meta_info = gst_meta_register ("GstPVRMeta", "GstPVRMeta", + if (g_once_init_enter (&pvr_meta_info)) { + const GstMetaInfo *meta = gst_meta_register ("GstPVRMeta", "GstPVRMeta", sizeof (GstPVRMeta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) gst_pvr_meta_free, (GstMetaCopyFunction) NULL, (GstMetaTransformFunction) NULL); + g_once_init_leave (&pvr_meta_info, meta); } return pvr_meta_info;