diff options
author | Michael Smith <msmith@rdio.com> | 2012-10-03 11:05:06 -0700 |
---|---|---|
committer | Michael Smith <msmith@rdio.com> | 2012-10-03 11:05:06 -0700 |
commit | 0c2159a220da1eb1f851f45ecb978d3c9939ad24 (patch) | |
tree | df62e201ffd814831a71942ac2b811c835585b50 /ext | |
parent | 4570e8bec853aa33cbe4dc8f2e67205a7d72136f (diff) | |
download | gstreamer-plugins-bad-0c2159a220da1eb1f851f45ecb978d3c9939ad24.tar.gz |
meta info: register thread-safely.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/directfb/dfbvideosink.c | 10 | ||||
-rw-r--r-- | ext/wayland/waylandpool.c | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index 7d7b6fe0f..be64cfddf 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 dd12d1005..ca380ea55 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; } |