summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-06-02 12:51:35 +0300
committerThibault Saunier <tsaunier@igalia.com>2020-06-04 13:33:16 -0400
commita5b1e1e96dd6199663053a53af458a64f32a1c93 (patch)
treeb90322e2c0524ebe187dad5e8ba92ad887e1def2 /gst
parent74f2f733be1516fae39f222a8f874478b93eb34f (diff)
downloadgstreamer-plugins-bad-a5b1e1e96dd6199663053a53af458a64f32a1c93.tar.gz
clockselect: Don't register GstClockSelectClockId multiple times
Diffstat (limited to 'gst')
-rw-r--r--gst/debugutils/gstclockselect.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/gst/debugutils/gstclockselect.c b/gst/debugutils/gstclockselect.c
index 4181e635a..3fa1a045c 100644
--- a/gst/debugutils/gstclockselect.c
+++ b/gst/debugutils/gstclockselect.c
@@ -49,19 +49,23 @@ static GType
gst_clock_select_clock_id_get_type (void)
{
static GType clock_id_type = 0;
- static const GEnumValue clock_id_types[] = {
- {GST_CLOCK_SELECT_CLOCK_ID_DEFAULT,
- "Default (elected from elements) pipeline clock", "default"},
- {GST_CLOCK_SELECT_CLOCK_ID_MONOTONIC, "System monotonic clock",
- "monotonic"},
- {GST_CLOCK_SELECT_CLOCK_ID_REALTIME, "System realtime clock", "realtime"},
- {GST_CLOCK_SELECT_CLOCK_ID_PTP, "PTP clock", "ptp"},
- {GST_CLOCK_SELECT_CLOCK_ID_TAI, "System TAI clock", "tai"},
- {0, NULL, NULL},
- };
-
- clock_id_type =
- g_enum_register_static ("GstClockSelectClockId", clock_id_types);
+
+ if (g_once_init_enter (&clock_id_type)) {
+ GType type;
+ static const GEnumValue clock_id_types[] = {
+ {GST_CLOCK_SELECT_CLOCK_ID_DEFAULT,
+ "Default (elected from elements) pipeline clock", "default"},
+ {GST_CLOCK_SELECT_CLOCK_ID_MONOTONIC, "System monotonic clock",
+ "monotonic"},
+ {GST_CLOCK_SELECT_CLOCK_ID_REALTIME, "System realtime clock", "realtime"},
+ {GST_CLOCK_SELECT_CLOCK_ID_PTP, "PTP clock", "ptp"},
+ {GST_CLOCK_SELECT_CLOCK_ID_TAI, "System TAI clock", "tai"},
+ {0, NULL, NULL},
+ };
+
+ type = g_enum_register_static ("GstClockSelectClockId", clock_id_types);
+ g_once_init_leave (&clock_id_type, type);
+ }
return clock_id_type;
}