diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/v4l2/gstv4l2bufferpool.c | 5 | ||||
-rw-r--r-- | sys/ximage/ximageutil.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 897231dfd..f6fabbb13 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -75,11 +75,12 @@ gst_v4l2_meta_get_info (void) { static const GstMetaInfo *meta_info = NULL; - if (meta_info == NULL) { - meta_info = + if (g_once_init_enter (&meta_info)) { + const GstMetaInfo *meta = gst_meta_register (gst_v4l2_meta_api_get_type (), "GstV4l2Meta", sizeof (GstV4l2Meta), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL); + g_once_init_leave (&meta_info, meta); } return meta_info; } diff --git a/sys/ximage/ximageutil.c b/sys/ximage/ximageutil.c index d81e9a4ad..35069fcfc 100644 --- a/sys/ximage/ximageutil.c +++ b/sys/ximage/ximageutil.c @@ -41,11 +41,12 @@ gst_meta_ximage_get_info (void) { static const GstMetaInfo *meta_ximage_info = NULL; - if (meta_ximage_info == NULL) { - meta_ximage_info = + if (g_once_init_enter (&meta_ximage_info)) { + const GstMetaInfo *meta = gst_meta_register (gst_meta_ximage_api_get_type (), "GstMetaXImageSrc", sizeof (GstMetaXImage), (GstMetaInitFunction) NULL, (GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL); + g_once_init_leave (&meta_ximage_info, meta); } return meta_ximage_info; } |