diff options
author | Matthew Waters <matthew@centricular.com> | 2021-03-19 17:21:01 +1100 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2021-03-19 17:21:22 +1100 |
commit | 083ae2b8ed658ff579de7eedea7fd728c1e49457 (patch) | |
tree | 1ffc70d23c54dce6a490aa3d50819409753e07d3 | |
parent | edf58d30e62d26b6433bd3c9c2ecbf6e690bdb68 (diff) |
gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead. GCC 11 has started warning about using volatile
with atomic operations.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/234>
-rw-r--r-- | ges/ges-smart-video-mixer.c | 4 | ||||
-rw-r--r-- | ges/gstframepositioner.c | 2 | ||||
-rw-r--r-- | plugins/nle/nlecomposition.c | 2 | ||||
-rw-r--r-- | plugins/nle/nleobject.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/ges/ges-smart-video-mixer.c b/ges/ges-smart-video-mixer.c index 80d89348..5d2c26d5 100644 --- a/ges/ges-smart-video-mixer.c +++ b/ges/ges-smart-video-mixer.c @@ -124,7 +124,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink_%u", typedef struct _PadInfos { - volatile gint refcount; + gint refcount; GESSmartMixer *self; GstPad *mixer_pad; @@ -149,7 +149,7 @@ static PadInfos * pad_infos_new (void) { PadInfos *info = g_new0 (PadInfos, 1); - info->refcount = 1; + g_atomic_int_set (&info->refcount, 1); return info; } diff --git a/ges/gstframepositioner.c b/ges/gstframepositioner.c index 9255c09e..4df3fdcc 100644 --- a/ges/gstframepositioner.c +++ b/ges/gstframepositioner.c @@ -624,7 +624,7 @@ gst_frame_positioner_get_property (GObject * object, guint property_id, GType gst_frame_positioner_meta_api_get_type (void) { - static volatile GType type; + static GType type; static const gchar *tags[] = { "video", NULL }; if (g_once_init_enter (&type)) { diff --git a/plugins/nle/nlecomposition.c b/plugins/nle/nlecomposition.c index da9fa932..26095407 100644 --- a/plugins/nle/nlecomposition.c +++ b/plugins/nle/nlecomposition.c @@ -195,7 +195,7 @@ struct _NleCompositionPrivate gint seqnum_to_restart_task; gboolean waiting_serialized_query_or_buffer; GstEvent *stack_initialization_seek; - volatile gboolean stack_initialization_seek_sent; + gboolean stack_initialization_seek_sent; gboolean tearing_down_stack; gboolean suppress_child_error; diff --git a/plugins/nle/nleobject.c b/plugins/nle/nleobject.c index 18133e5c..e746dd1a 100644 --- a/plugins/nle/nleobject.c +++ b/plugins/nle/nleobject.c @@ -835,7 +835,7 @@ nle_object_reset (NleObject * object) GType nle_object_get_type (void) { - static volatile gsize type = 0; + static gsize type = 0; if (g_once_init_enter (&type)) { GType _type; |