From eeccb330d04dcd0669d7623f033cba7709f05e80 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Tue, 10 Sep 2019 22:43:49 +0200 Subject: [PATCH] smpte: don't register transition types twice --- gst/smpte/barboxwipes.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gst/smpte/barboxwipes.c b/gst/smpte/barboxwipes.c index 7855eaabbc..4f4e62e42a 100644 --- a/gst/smpte/barboxwipes.c +++ b/gst/smpte/barboxwipes.c @@ -948,10 +948,16 @@ static const GstMaskDefinition definitions[] = { void _gst_barboxwipes_register (void) { - gint i = 0; + static gsize id = 0; - while (definitions[i].short_name) { - _gst_mask_register (&definitions[i]); - i++; + if (g_once_init_enter (&id)) { + gint i = 0; + + while (definitions[i].short_name) { + _gst_mask_register (&definitions[i]); + i++; + } + + g_once_init_leave (&id, 1); } }