diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2021-07-27 11:49:47 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2021-07-27 13:22:35 -0400 |
commit | 03041842dec6d8be8ae84f2215ac42d51b8bfa32 (patch) | |
tree | d371d36d4c01d8cc7dd990bfd6bbf859c0753261 /gst/debugutils | |
parent | b3504a0192d47766d5c1d4a29594c03275a24ed3 (diff) | |
download | gstreamer-plugins-bad-03041842dec6d8be8ae84f2215ac42d51b8bfa32.tar.gz |
debugutils: Only proxy the properties once
The needed once call was removed accidently during porting. This was catch by
the CI as memory leaks.
Related to !2426
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2438>
Diffstat (limited to 'gst/debugutils')
-rw-r--r-- | gst/debugutils/gstfakeaudiosink.c | 14 | ||||
-rw-r--r-- | gst/debugutils/gstfakevideosink.c | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/gst/debugutils/gstfakeaudiosink.c b/gst/debugutils/gstfakeaudiosink.c index ef736eb24..5b962a215 100644 --- a/gst/debugutils/gstfakeaudiosink.c +++ b/gst/debugutils/gstfakeaudiosink.c @@ -63,6 +63,18 @@ GST_ELEMENT_REGISTER_DEFINE (fakeaudiosink, "fakeaudiosink", GST_RANK_NONE, gst_fake_audio_sink_get_type ()); static void +gst_fake_audio_sink_proxy_properties (GstFakeAudioSink * self, + GstElement * child) +{ + static gsize initialized = 0; + + if (g_once_init_enter (&initialized)) { + gst_fake_sink_proxy_properties (GST_ELEMENT_CAST (self), child, PROP_LAST); + g_once_init_leave (&initialized, 1); + } +} + +static void gst_fake_audio_sink_init (GstFakeAudioSink * self) { GstElement *child; @@ -89,7 +101,7 @@ gst_fake_audio_sink_init (GstFakeAudioSink * self) self->child = child; - gst_fake_sink_proxy_properties (GST_ELEMENT_CAST (self), child, PROP_LAST); + gst_fake_audio_sink_proxy_properties (self, child); } else { g_warning ("Check your GStreamer installation, " "core element 'fakesink' is missing."); diff --git a/gst/debugutils/gstfakevideosink.c b/gst/debugutils/gstfakevideosink.c index 837a76584..571c20a33 100644 --- a/gst/debugutils/gstfakevideosink.c +++ b/gst/debugutils/gstfakevideosink.c @@ -128,6 +128,18 @@ gst_fake_video_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) } static void +gst_fake_video_sink_proxy_properties (GstFakeVideoSink * self, + GstElement * child) +{ + static gsize initialized = 0; + + if (g_once_init_enter (&initialized)) { + gst_fake_sink_proxy_properties (GST_ELEMENT_CAST (self), child, PROP_LAST); + g_once_init_leave (&initialized, 1); + } +} + +static void gst_fake_video_sink_init (GstFakeVideoSink * self) { GstElement *child; @@ -157,7 +169,7 @@ gst_fake_video_sink_init (GstFakeVideoSink * self) self->child = child; - gst_fake_sink_proxy_properties (GST_ELEMENT_CAST (self), child, PROP_LAST); + gst_fake_video_sink_proxy_properties (self, child); } else { g_warning ("Check your GStreamer installation, " "core element 'fakesink' is missing."); |