diff options
author | Michael Smith <msmith@rdio.com> | 2012-10-03 10:51:45 -0700 |
---|---|---|
committer | Michael Smith <msmith@rdio.com> | 2012-10-03 10:51:45 -0700 |
commit | b04b1b5089a2891d8da53e3e6bd4d6d78b977214 (patch) | |
tree | 25914c636150006ff3d07d1cf7c50d3410cdd17a /sys/ximage | |
parent | b10829d6c859fb2aa30897186710802d4ec88571 (diff) |
meta info: threadsafe registration using g_once
Diffstat (limited to 'sys/ximage')
-rw-r--r-- | sys/ximage/ximageutil.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |