1 From 68858358544dd3b7e20663f731db22fd74a78a45 Mon Sep 17 00:00:00 2001
2 From: Matthew Waters <matthew@centricular.com>
3 Date: Mon, 22 Mar 2021 14:34:36 +1100
4 Subject: [PATCH] gst: don't use volatile to mean atomic
5
6 volatile is not sufficient to provide atomic guarantees and real atomics
7 should be used instead. GCC 11 has started warning about using volatile
8 with atomic operations.
9
10 https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
11
12 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868
13
14 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2155>
15 ---
16 ext/colormanagement/gstlcms.c | 4 ++--
17 ext/curl/gstcurlqueue.h | 2 +-
18 ext/iqa/iqa.c | 2 +-
19 ext/opencv/gstcvdilateerode.cpp | 2 +-
20 ext/openjpeg/gstopenjpegenc.c | 2 +-
21 ext/resindvd/rsndec.c | 2 +-
22 ext/sctp/sctpassociation.c | 2 +-
23 ext/ttml/subtitlemeta.c | 2 +-
24 ext/wildmidi/gstwildmididec.c | 2 +-
25 gst-libs/gst/adaptivedemux/gstadaptivedemux.c | 6 +++---
26 gst-libs/gst/audio/gstnonstreamaudiodecoder.c | 2 +-
27 gst-libs/gst/codecparsers/gstmpegvideometa.c | 2 +-
28 gst-libs/gst/sctp/sctpreceivemeta.c | 2 +-
29 gst-libs/gst/sctp/sctpsendmeta.c | 2 +-
30 gst-libs/gst/vulkan/android/gstvkwindow_android.c | 2 +-
31 gst-libs/gst/vulkan/cocoa/gstvkwindow_cocoa.m | 2 +-
32 gst-libs/gst/vulkan/gstvkbuffermemory.c | 2 +-
33 gst-libs/gst/vulkan/gstvkcommandbuffer.c | 2 +-
34 gst-libs/gst/vulkan/gstvkdescriptorset.c | 2 +-
35 gst-libs/gst/vulkan/gstvkdevice.c | 2 +-
36 gst-libs/gst/vulkan/gstvkdisplay.c | 2 +-
37 gst-libs/gst/vulkan/gstvkfence.c | 2 +-
38 gst-libs/gst/vulkan/gstvkhandle.c | 2 +-
39 gst-libs/gst/vulkan/gstvkimagememory.c | 2 +-
40 gst-libs/gst/vulkan/gstvkimageview.c | 2 +-
41 gst-libs/gst/vulkan/gstvkinstance.c | 2 +-
42 gst-libs/gst/vulkan/gstvkmemory.c | 2 +-
43 gst-libs/gst/vulkan/gstvkphysicaldevice.c | 2 +-
44 gst-libs/gst/vulkan/gstvkqueue.c | 2 +-
45 gst-libs/gst/vulkan/gstvktrash.c | 2 +-
46 gst-libs/gst/vulkan/gstvkutils.c | 2 +-
47 gst-libs/gst/vulkan/gstvkwindow.c | 2 +-
48 gst-libs/gst/vulkan/ios/gstvkwindow_ios.m | 2 +-
49 gst-libs/gst/vulkan/vulkan_mkenum.py | 4 ++--
50 gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c | 2 +-
51 gst-libs/gst/vulkan/xcb/gstvkwindow_xcb.c | 2 +-
52 gst/camerabin2/gstcamerabin2.c | 2 +-
53 gst/debugutils/gstfakevideosink.c | 2 +-
54 gst/mxf/mxfmetadata.c | 2 +-
55 gst/netsim/gstnetsim.c | 8 ++++----
56 gst/rtmp2/rtmp/amf.c | 2 +-
57 gst/rtmp2/rtmp/rtmpchunkstream.c | 2 +-
58 gst/rtmp2/rtmp/rtmpclient.c | 8 ++++----
59 gst/rtmp2/rtmp/rtmphandshake.c | 2 +-
60 gst/rtmp2/rtmp/rtmpmessage.c | 2 +-
61 gst/segmentclip/gstsegmentclip.c | 2 +-
62 sys/androidmedia/gstamcaudiodec.c | 2 +-
63 sys/androidmedia/gstamcvideodec.c | 2 +-
64 sys/androidmedia/gstamcvideoenc.c | 2 +-
65 sys/applemedia/coremediabuffer.c | 2 +-
66 sys/applemedia/corevideobuffer.c | 2 +-
67 sys/applemedia/corevideomemory.c | 2 +-
68 sys/applemedia/iosglmemory.c | 2 +-
69 sys/applemedia/iosurfaceglmemory.c | 2 +-
70 sys/applemedia/iosurfacevulkanmemory.c | 2 +-
71 sys/bluez/gstavdtpsrc.h | 2 +-
72 sys/d3d11/gstd3d11decoder.c | 2 +-
73 sys/d3d11/gstd3d11device.c | 4 ++--
74 sys/d3d11/gstd3d11shader.c | 2 +-
75 sys/d3d11/gstd3d11utils.c | 2 +-
76 sys/d3d11/gstd3d11videoprocessor.c | 4 ++--
77 sys/d3d11/gstd3d11window.cpp | 2 +-
78 sys/d3d11/gstd3d11window_win32.cpp | 2 +-
79 sys/ipcpipeline/gstipcpipelinecomm.c | 2 +-
80 sys/msdk/gstmsdkcontextutil.c | 2 +-
81 sys/nvcodec/gstcudacontext.c | 2 +-
82 sys/nvcodec/gstcudautils.c | 4 ++--
83 sys/nvcodec/gstnvbaseenc.h | 2 +-
84 sys/opensles/openslescommon.c | 4 ++--
85 sys/va/gstvaallocator.c | 6 +++---
86 sys/va/gstvautils.c | 2 +-
87 sys/wasapi/gstwasapiutil.c | 2 +-
88 sys/wasapi2/gstwasapi2client.cpp | 2 +-
89 sys/winscreencap/dxgicapture.c | 2 +-
90 tests/check/libs/vkimage.c | 4 ++--
91 75 files changed, 92 insertions(+), 92 deletions(-)
92
93 diff --git a/ext/colormanagement/gstlcms.c b/ext/colormanagement/gstlcms.c
94 index ebcc4438b8..84f694bf09 100644
95 --- a/ext/colormanagement/gstlcms.c
96 +++ b/ext/colormanagement/gstlcms.c
97 @@ -67,7 +67,7 @@ enum
98 GType
99 gst_lcms_intent_get_type (void)
100 {
101 - static volatile gsize intent_type = 0;
102 + static gsize intent_type = 0;
103 static const GEnumValue intent[] = {
104 {GST_LCMS_INTENT_PERCEPTUAL, "Perceptual",
105 "perceptual"},
106 @@ -90,7 +90,7 @@ gst_lcms_intent_get_type (void)
107 static GType
108 gst_lcms_lookup_method_get_type (void)
109 {
110 - static volatile gsize lookup_method_type = 0;
111 + static gsize lookup_method_type = 0;
112 static const GEnumValue lookup_method[] = {
113 {GST_LCMS_LOOKUP_METHOD_UNCACHED,
114 "Uncached, calculate every pixel on the fly (very slow playback)",
115 diff --git a/ext/curl/gstcurlqueue.h b/ext/curl/gstcurlqueue.h
116 index e43359a585..eea1d9610b 100644
117 --- a/ext/curl/gstcurlqueue.h
118 +++ b/ext/curl/gstcurlqueue.h
119 @@ -51,7 +51,7 @@
120 struct _GstCurlHttpSrcQueueElement
121 {
122 GstCurlHttpSrc *p;
123 - volatile gint running;
124 + gint running;
125 GstCurlHttpSrcQueueElement *next;
126 };
127
128 diff --git a/ext/iqa/iqa.c b/ext/iqa/iqa.c
129 index c27bcd9f51..7cc45b88c5 100644
130 --- a/ext/iqa/iqa.c
131 +++ b/ext/iqa/iqa.c
132 @@ -159,7 +159,7 @@ gst_iqa_mode_flags_get_type (void)
133 {GST_IQA_MODE_STRICT, "Strict comparison of frames.", "strict"},
134 {0, NULL, NULL}
135 };
136 - static volatile GType id = 0;
137 + static GType id = 0;
138
139 if (g_once_init_enter ((gsize *) & id)) {
140 GType _id;
141 diff --git a/ext/opencv/gstcvdilateerode.cpp b/ext/opencv/gstcvdilateerode.cpp
142 index 77a7ec4599..ad4d2ad887 100644
143 --- a/ext/opencv/gstcvdilateerode.cpp
144 +++ b/ext/opencv/gstcvdilateerode.cpp
145 @@ -87,7 +87,7 @@ static void gst_cv_dilate_erode_get_property (GObject * object, guint prop_id,
146 GType
147 gst_cv_dilate_erode_get_type (void)
148 {
149 - static volatile gsize opencv_dilate_erode_type = 0;
150 + static gsize opencv_dilate_erode_type = 0;
151
152 if (g_once_init_enter (&opencv_dilate_erode_type)) {
153 GType _type;
154 diff --git a/ext/openjpeg/gstopenjpegenc.c b/ext/openjpeg/gstopenjpegenc.c
155 index 307d753d09..df12ea1b2e 100644
156 --- a/ext/openjpeg/gstopenjpegenc.c
157 +++ b/ext/openjpeg/gstopenjpegenc.c
158 @@ -44,7 +44,7 @@ gst_openjpeg_enc_progression_order_get_type (void)
159 {OPJ_CPRL, "CPRL", "crpl"},
160 {0, NULL, NULL}
161 };
162 - static volatile GType id = 0;
163 + static GType id = 0;
164
165 if (g_once_init_enter ((gsize *) & id)) {
166 GType _id;
167 diff --git a/ext/resindvd/rsndec.c b/ext/resindvd/rsndec.c
168 index 4f4b2680f5..bb747757fe 100644
169 --- a/ext/resindvd/rsndec.c
170 +++ b/ext/resindvd/rsndec.c
171 @@ -346,7 +346,7 @@ rsn_dec_change_state (GstElement * element, GstStateChange transition)
172 GType
173 rsn_dec_get_type (void)
174 {
175 - static volatile gsize type = 0;
176 + static gsize type = 0;
177
178 if (g_once_init_enter (&type)) {
179 GType _type;
180 diff --git a/ext/sctp/sctpassociation.c b/ext/sctp/sctpassociation.c
181 index dd98eb1766..fbf5b4afef 100644
182 --- a/ext/sctp/sctpassociation.c
183 +++ b/ext/sctp/sctpassociation.c
184 @@ -56,7 +56,7 @@ gst_sctp_association_state_get_type (void)
185 {GST_SCTP_ASSOCIATION_STATE_ERROR, "state-error", "state-error"},
186 {0, NULL, NULL}
187 };
188 - static volatile GType id = 0;
189 + static GType id = 0;
190
191 if (g_once_init_enter ((gsize *) & id)) {
192 GType _id;
193 diff --git a/ext/ttml/subtitlemeta.c b/ext/ttml/subtitlemeta.c
194 index cdbfcce243..3ce569f6e8 100644
195 --- a/ext/ttml/subtitlemeta.c
196 +++ b/ext/ttml/subtitlemeta.c
197 @@ -32,7 +32,7 @@
198 GType
199 gst_subtitle_meta_api_get_type (void)
200 {
201 - static volatile GType type;
202 + static GType type;
203 static const gchar *tags[] = { "memory", NULL };
204
205 if (g_once_init_enter (&type)) {
206 diff --git a/ext/wildmidi/gstwildmididec.c b/ext/wildmidi/gstwildmididec.c
207 index d628c0fe6c..b90488bd22 100644
208 --- a/ext/wildmidi/gstwildmididec.c
209 +++ b/ext/wildmidi/gstwildmididec.c
210 @@ -151,7 +151,7 @@ static void gst_wildmidi_dec_update_options (GstWildmidiDec * wildmidi_dec);
211
212 static GMutex load_mutex;
213 static unsigned long init_refcount = 0;
214 -static volatile gint wildmidi_initialized = 0;
215 +static gint wildmidi_initialized = 0;
216
217
218 static gchar *
219 diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
220 index e32444eaa7..a495ec2e7a 100644
221 --- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
222 +++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
223 @@ -211,7 +211,7 @@ struct _GstAdaptiveDemuxPrivate
224
225 typedef struct _GstAdaptiveDemuxTimer
226 {
227 - volatile gint ref_count;
228 + gint ref_count;
229 GCond *cond;
230 GMutex *mutex;
231 GstClockID clock_id;
232 @@ -312,7 +312,7 @@ gst_adaptive_demux_requires_periodical_playlist_update_default (GstAdaptiveDemux
233 GType
234 gst_adaptive_demux_get_type (void)
235 {
236 - static volatile gsize type = 0;
237 + static gsize type = 0;
238
239 if (g_once_init_enter (&type)) {
240 GType _type;
241 @@ -4577,7 +4577,7 @@ gst_adaptive_demux_timer_new (GCond * cond, GMutex * mutex)
242 timer->fired = FALSE;
243 timer->cond = cond;
244 timer->mutex = mutex;
245 - timer->ref_count = 1;
246 + g_atomic_int_set (&timer->ref_count, 1);
247 return timer;
248 }
249
250 diff --git a/gst-libs/gst/audio/gstnonstreamaudiodecoder.c b/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
251 index ca8afce6aa..f98ddb014d 100644
252 --- a/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
253 +++ b/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
254 @@ -339,7 +339,7 @@ gst_nonstream_audio_decoder_subsong_mode_get_type (void)
255 GType
256 gst_nonstream_audio_decoder_get_type (void)
257 {
258 - static volatile gsize nonstream_audio_decoder_type = 0;
259 + static gsize nonstream_audio_decoder_type = 0;
260
261 if (g_once_init_enter (&nonstream_audio_decoder_type)) {
262 GType type_;
263 diff --git a/gst-libs/gst/codecparsers/gstmpegvideometa.c b/gst-libs/gst/codecparsers/gstmpegvideometa.c
264 index 4b9a71bacb..bce5c67d69 100644
265 --- a/gst-libs/gst/codecparsers/gstmpegvideometa.c
266 +++ b/gst-libs/gst/codecparsers/gstmpegvideometa.c
267 @@ -96,7 +96,7 @@ gst_mpeg_video_meta_transform (GstBuffer * dest, GstMeta * meta,
268 GType
269 gst_mpeg_video_meta_api_get_type (void)
270 {
271 - static volatile GType type;
272 + static GType type;
273 static const gchar *tags[] = { "memory", NULL }; /* don't know what to set here */
274
275 if (g_once_init_enter (&type)) {
276 diff --git a/gst-libs/gst/sctp/sctpreceivemeta.c b/gst-libs/gst/sctp/sctpreceivemeta.c
277 index e1c77d4660..11def65238 100644
278 --- a/gst-libs/gst/sctp/sctpreceivemeta.c
279 +++ b/gst-libs/gst/sctp/sctpreceivemeta.c
280 @@ -37,7 +37,7 @@ GType
281 gst_sctp_receive_meta_api_get_type (void)
282 {
283 static const gchar *tags[] = { NULL };
284 - static volatile GType type;
285 + static GType type;
286 if (g_once_init_enter (&type)) {
287 GType _type = gst_meta_api_type_register ("GstSctpReceiveMetaAPI", tags);
288 g_once_init_leave (&type, _type);
289 diff --git a/gst-libs/gst/sctp/sctpsendmeta.c b/gst-libs/gst/sctp/sctpsendmeta.c
290 index d8ce14fc93..e29cd7d927 100644
291 --- a/gst-libs/gst/sctp/sctpsendmeta.c
292 +++ b/gst-libs/gst/sctp/sctpsendmeta.c
293 @@ -37,7 +37,7 @@ GType
294 gst_sctp_send_meta_api_get_type (void)
295 {
296 static const gchar *tags[] = { NULL };
297 - static volatile GType type;
298 + static GType type;
299 if (g_once_init_enter (&type)) {
300 GType _type = gst_meta_api_type_register ("GstSctpSendMetaAPI", tags);
301 g_once_init_leave (&type, _type);
302 diff --git a/gst-libs/gst/vulkan/android/gstvkwindow_android.c b/gst-libs/gst/vulkan/android/gstvkwindow_android.c
303 index c1bd866acd..a745d54cea 100644
304 --- a/gst-libs/gst/vulkan/android/gstvkwindow_android.c
305 +++ b/gst-libs/gst/vulkan/android/gstvkwindow_android.c
306 @@ -37,7 +37,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
307 static void
308 _init_debug (void)
309 {
310 - static volatile gsize _init = 0;
311 + static gsize _init = 0;
312
313 if (g_once_init_enter (&_init)) {
314 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowandroid", 0,
315 diff --git a/gst-libs/gst/vulkan/cocoa/gstvkwindow_cocoa.m b/gst-libs/gst/vulkan/cocoa/gstvkwindow_cocoa.m
316 index f007262671..fd8e22742e 100644
317 --- a/gst-libs/gst/vulkan/cocoa/gstvkwindow_cocoa.m
318 +++ b/gst-libs/gst/vulkan/cocoa/gstvkwindow_cocoa.m
319 @@ -42,7 +42,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
320 static void
321 _init_debug (void)
322 {
323 - static volatile gsize _init = 0;
324 + static gsize _init = 0;
325
326 if (g_once_init_enter (&_init)) {
327 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowmacos", 0,
328 diff --git a/gst-libs/gst/vulkan/gstvkbuffermemory.c b/gst-libs/gst/vulkan/gstvkbuffermemory.c
329 index 967ef9d27d..515aff0d0c 100644
330 --- a/gst-libs/gst/vulkan/gstvkbuffermemory.c
331 +++ b/gst-libs/gst/vulkan/gstvkbuffermemory.c
332 @@ -363,7 +363,7 @@ gst_vulkan_buffer_memory_allocator_init (GstVulkanBufferMemoryAllocator *
333 void
334 gst_vulkan_buffer_memory_init_once (void)
335 {
336 - static volatile gsize _init = 0;
337 + static gsize _init = 0;
338
339 if (g_once_init_enter (&_init)) {
340 GST_DEBUG_CATEGORY_INIT (GST_CAT_VULKAN_BUFFER_MEMORY, "vulkanbuffermemory",
341 diff --git a/gst-libs/gst/vulkan/gstvkcommandbuffer.c b/gst-libs/gst/vulkan/gstvkcommandbuffer.c
342 index 2719ba3e37..7b0d310da0 100644
343 --- a/gst-libs/gst/vulkan/gstvkcommandbuffer.c
344 +++ b/gst-libs/gst/vulkan/gstvkcommandbuffer.c
345 @@ -41,7 +41,7 @@ GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
346 static void
347 init_debug (void)
348 {
349 - static volatile gsize _init = 0;
350 + static gsize _init = 0;
351
352 if (g_once_init_enter (&_init)) {
353 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkancommandbuffer", 0,
354 diff --git a/gst-libs/gst/vulkan/gstvkdescriptorset.c b/gst-libs/gst/vulkan/gstvkdescriptorset.c
355 index ad2280d20e..1718382d80 100644
356 --- a/gst-libs/gst/vulkan/gstvkdescriptorset.c
357 +++ b/gst-libs/gst/vulkan/gstvkdescriptorset.c
358 @@ -44,7 +44,7 @@ GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
359 static void
360 init_debug (void)
361 {
362 - static volatile gsize _init = 0;
363 + static gsize _init = 0;
364
365 if (g_once_init_enter (&_init)) {
366 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkandescriptorset", 0,
367 diff --git a/gst-libs/gst/vulkan/gstvkdevice.c b/gst-libs/gst/vulkan/gstvkdevice.c
368 index e5f57d10ca..639406de0f 100644
369 --- a/gst-libs/gst/vulkan/gstvkdevice.c
370 +++ b/gst-libs/gst/vulkan/gstvkdevice.c
371 @@ -67,7 +67,7 @@ struct _GstVulkanDevicePrivate
372 static void
373 _init_debug (void)
374 {
375 - static volatile gsize init;
376 + static gsize init;
377
378 if (g_once_init_enter (&init)) {
379 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkandevice", 0,
380 diff --git a/gst-libs/gst/vulkan/gstvkdisplay.c b/gst-libs/gst/vulkan/gstvkdisplay.c
381 index 345234985f..fc87417b66 100644
382 --- a/gst-libs/gst/vulkan/gstvkdisplay.c
383 +++ b/gst-libs/gst/vulkan/gstvkdisplay.c
384 @@ -59,7 +59,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
385 static void
386 _init_debug (void)
387 {
388 - static volatile gsize _init = 0;
389 + static gsize _init = 0;
390
391 if (g_once_init_enter (&_init)) {
392 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkandisplay", 0,
393 diff --git a/gst-libs/gst/vulkan/gstvkfence.c b/gst-libs/gst/vulkan/gstvkfence.c
394 index cdfcefe0ac..9e03a24b50 100644
395 --- a/gst-libs/gst/vulkan/gstvkfence.c
396 +++ b/gst-libs/gst/vulkan/gstvkfence.c
397 @@ -42,7 +42,7 @@ GST_DEBUG_CATEGORY (gst_debug_vulkan_fence);
398 static void
399 _init_debug (void)
400 {
401 - static volatile gsize init;
402 + static gsize init;
403
404 if (g_once_init_enter (&init)) {
405 GST_DEBUG_CATEGORY_INIT (gst_debug_vulkan_fence,
406 diff --git a/gst-libs/gst/vulkan/gstvkhandle.c b/gst-libs/gst/vulkan/gstvkhandle.c
407 index 454f845465..8219030d42 100644
408 --- a/gst-libs/gst/vulkan/gstvkhandle.c
409 +++ b/gst-libs/gst/vulkan/gstvkhandle.c
410 @@ -40,7 +40,7 @@ GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
411 static void
412 init_debug (void)
413 {
414 - static volatile gsize _init = 0;
415 + static gsize _init = 0;
416
417 if (g_once_init_enter (&_init)) {
418 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanhandle", 0,
419 diff --git a/gst-libs/gst/vulkan/gstvkimagememory.c b/gst-libs/gst/vulkan/gstvkimagememory.c
420 index 8a0328433c..7a242496ef 100644
421 --- a/gst-libs/gst/vulkan/gstvkimagememory.c
422 +++ b/gst-libs/gst/vulkan/gstvkimagememory.c
423 @@ -705,7 +705,7 @@ gst_vulkan_image_memory_allocator_init (GstVulkanImageMemoryAllocator *
424 void
425 gst_vulkan_image_memory_init_once (void)
426 {
427 - static volatile gsize _init = 0;
428 + static gsize _init = 0;
429
430 if (g_once_init_enter (&_init)) {
431 GST_DEBUG_CATEGORY_INIT (GST_CAT_VULKAN_IMAGE_MEMORY, "vulkanimagememory",
432 diff --git a/gst-libs/gst/vulkan/gstvkimageview.c b/gst-libs/gst/vulkan/gstvkimageview.c
433 index 655a77865d..c8f86bad9e 100644
434 --- a/gst-libs/gst/vulkan/gstvkimageview.c
435 +++ b/gst-libs/gst/vulkan/gstvkimageview.c
436 @@ -40,7 +40,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFUALT);
437 static void
438 init_debug (void)
439 {
440 - static volatile gsize _init = 0;
441 + static gsize _init = 0;
442
443 if (g_once_init_enter (&_init)) {
444 GST_DEBUG_CATEGORY_INIT (GST_CAT_VULKAN_IMAGE_VIEW, "vulkanimageview",
445 diff --git a/gst-libs/gst/vulkan/gstvkinstance.c b/gst-libs/gst/vulkan/gstvkinstance.c
446 index 0dbf26f9cd..14db32922e 100644
447 --- a/gst-libs/gst/vulkan/gstvkinstance.c
448 +++ b/gst-libs/gst/vulkan/gstvkinstance.c
449 @@ -96,7 +96,7 @@ struct _GstVulkanInstancePrivate
450 static void
451 _init_debug (void)
452 {
453 - static volatile gsize _init = 0;
454 + static gsize _init = 0;
455
456 if (g_once_init_enter (&_init)) {
457 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkaninstance", 0,
458 diff --git a/gst-libs/gst/vulkan/gstvkmemory.c b/gst-libs/gst/vulkan/gstvkmemory.c
459 index f70333258f..40ed31e8ff 100644
460 --- a/gst-libs/gst/vulkan/gstvkmemory.c
461 +++ b/gst-libs/gst/vulkan/gstvkmemory.c
462 @@ -309,7 +309,7 @@ gst_vulkan_memory_allocator_init (GstVulkanMemoryAllocator * allocator)
463 void
464 gst_vulkan_memory_init_once (void)
465 {
466 - static volatile gsize _init = 0;
467 + static gsize _init = 0;
468
469 if (g_once_init_enter (&_init)) {
470 GST_DEBUG_CATEGORY_INIT (GST_CAT_VULKAN_MEMORY, "vulkanmemory", 0,
471 diff --git a/gst-libs/gst/vulkan/gstvkphysicaldevice.c b/gst-libs/gst/vulkan/gstvkphysicaldevice.c
472 index cf9be303bb..33f9f20553 100644
473 --- a/gst-libs/gst/vulkan/gstvkphysicaldevice.c
474 +++ b/gst-libs/gst/vulkan/gstvkphysicaldevice.c
475 @@ -71,7 +71,7 @@ struct _GstVulkanPhysicalDevicePrivate
476 static void
477 _init_debug (void)
478 {
479 - static volatile gsize init;
480 + static gsize init;
481
482 if (g_once_init_enter (&init)) {
483 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkandevice", 0,
484 diff --git a/gst-libs/gst/vulkan/gstvkqueue.c b/gst-libs/gst/vulkan/gstvkqueue.c
485 index 0763b83d6e..025b9b235b 100644
486 --- a/gst-libs/gst/vulkan/gstvkqueue.c
487 +++ b/gst-libs/gst/vulkan/gstvkqueue.c
488 @@ -40,7 +40,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
489 static void
490 _init_debug (void)
491 {
492 - static volatile gsize init;
493 + static gsize init;
494
495 if (g_once_init_enter (&init)) {
496 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanqueue", 0, "Vulkan Queue");
497 diff --git a/gst-libs/gst/vulkan/gstvktrash.c b/gst-libs/gst/vulkan/gstvktrash.c
498 index 56c12bafe7..a5c38ccaa4 100644
499 --- a/gst-libs/gst/vulkan/gstvktrash.c
500 +++ b/gst-libs/gst/vulkan/gstvktrash.c
501 @@ -44,7 +44,7 @@ GST_DEBUG_CATEGORY (gst_debug_vulkan_trash);
502 static void
503 _init_debug (void)
504 {
505 - static volatile gsize init;
506 + static gsize init;
507
508 if (g_once_init_enter (&init)) {
509 GST_DEBUG_CATEGORY_INIT (gst_debug_vulkan_trash,
510 diff --git a/gst-libs/gst/vulkan/gstvkutils.c b/gst-libs/gst/vulkan/gstvkutils.c
511 index 15af242d6c..446a3e4429 100644
512 --- a/gst-libs/gst/vulkan/gstvkutils.c
513 +++ b/gst-libs/gst/vulkan/gstvkutils.c
514 @@ -37,7 +37,7 @@ static void
515 _init_context_debug (void)
516 {
517 #ifndef GST_DISABLE_GST_DEBUG
518 - static volatile gsize _init = 0;
519 + static gsize _init = 0;
520
521 if (g_once_init_enter (&_init)) {
522 GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
523 diff --git a/gst-libs/gst/vulkan/gstvkwindow.c b/gst-libs/gst/vulkan/gstvkwindow.c
524 index bcccfe5146..ed5a784c9f 100644
525 --- a/gst-libs/gst/vulkan/gstvkwindow.c
526 +++ b/gst-libs/gst/vulkan/gstvkwindow.c
527 @@ -138,7 +138,7 @@ gst_vulkan_window_default_close (GstVulkanWindow * window)
528 static void
529 _init_debug (void)
530 {
531 - static volatile gsize _init = 0;
532 + static gsize _init = 0;
533
534 if (g_once_init_enter (&_init)) {
535 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindow", 0,
536 diff --git a/gst-libs/gst/vulkan/ios/gstvkwindow_ios.m b/gst-libs/gst/vulkan/ios/gstvkwindow_ios.m
537 index 84fc33deb3..db23e77ae1 100644
538 --- a/gst-libs/gst/vulkan/ios/gstvkwindow_ios.m
539 +++ b/gst-libs/gst/vulkan/ios/gstvkwindow_ios.m
540 @@ -41,7 +41,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
541 static void
542 _init_debug (void)
543 {
544 - static volatile gsize _init = 0;
545 + static gsize _init = 0;
546
547 if (g_once_init_enter (&_init)) {
548 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowios", 0,
549 diff --git a/gst-libs/gst/vulkan/vulkan_mkenum.py b/gst-libs/gst/vulkan/vulkan_mkenum.py
550 index 0d1ecfe097..59a6bbc3eb 100644
551 --- a/gst-libs/gst/vulkan/vulkan_mkenum.py
552 +++ b/gst-libs/gst/vulkan/vulkan_mkenum.py
553 @@ -22,11 +22,11 @@ c_array = ['--fhead',
554 '--fprod',
555 "\n/* enumerations from \"@basename@\" */",
556 '--vhead',
557 - "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n if (g_once_init_enter (&g_define_type_id__volatile)) {\n static const G@Type@Value values[] = {",
558 + "GType\n@enum_name@_get_type (void)\n{\n static gsize static_g_define_type_id = 0;\n if (g_once_init_enter (&static_g_define_type_id)) {\n static const G@Type@Value values[] = {",
559 '--vprod',
560 " { C_@TYPE@ (@VALUENAME@), \"@VALUENAME@\", \"@valuenick@\" },",
561 '--vtail',
562 - " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n return g_define_type_id__volatile;\n}\n"
563 + " { 0, NULL, NULL }\n };\n GType g_define_type_id = g_@type@_register_static (\"@EnumName@\", values);\n g_once_init_leave (&static_g_define_type_id, g_define_type_id);\n }\n return static_g_define_type_id;\n}\n"
564 ]
565
566 cmd = []
567 diff --git a/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c b/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
568 index eda063de92..5d3f5c48df 100644
569 --- a/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
570 +++ b/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
571 @@ -37,7 +37,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
572 static void
573 _init_debug (void)
574 {
575 - static volatile gsize _init = 0;
576 + static gsize _init = 0;
577
578 if (g_once_init_enter (&_init)) {
579 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowxcb", 0,
580 diff --git a/gst-libs/gst/vulkan/xcb/gstvkwindow_xcb.c b/gst-libs/gst/vulkan/xcb/gstvkwindow_xcb.c
581 index b0f1ab4d0f..285943b12e 100644
582 --- a/gst-libs/gst/vulkan/xcb/gstvkwindow_xcb.c
583 +++ b/gst-libs/gst/vulkan/xcb/gstvkwindow_xcb.c
584 @@ -39,7 +39,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
585 static void
586 _init_debug (void)
587 {
588 - static volatile gsize _init = 0;
589 + static gsize _init = 0;
590
591 if (g_once_init_enter (&_init)) {
592 GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowxcb", 0,
593 diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
594 index 584e3e3167..502ed736da 100644
595 --- a/gst/camerabin2/gstcamerabin2.c
596 +++ b/gst/camerabin2/gstcamerabin2.c
597 @@ -263,7 +263,7 @@ gst_cam_flags_get_type (void)
598 "elements", "no-image-conversion"},
599 {0, NULL, NULL}
600 };
601 - static volatile GType id = 0;
602 + static GType id = 0;
603
604 if (g_once_init_enter ((gsize *) & id)) {
605 GType _id;
606 diff --git a/gst/debugutils/gstfakevideosink.c b/gst/debugutils/gstfakevideosink.c
607 index 3ebc9a360b..ddb2ae1a0e 100644
608 --- a/gst/debugutils/gstfakevideosink.c
609 +++ b/gst/debugutils/gstfakevideosink.c
610 @@ -54,7 +54,7 @@ gst_fake_video_sink_allocation_meta_flags_get_type (void)
611 "overlay-composition"},
612 {0, NULL, NULL}
613 };
614 - static volatile GType id = 0;
615 + static GType id = 0;
616
617 if (g_once_init_enter ((gsize *) & id)) {
618 GType _id;
619 diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c
620 index 2860b68479..c8d34060d0 100644
621 --- a/gst/mxf/mxfmetadata.c
622 +++ b/gst/mxf/mxfmetadata.c
623 @@ -6581,7 +6581,7 @@ mxf_descriptive_metadata_new (guint8 scheme, guint32 type,
624 GType
625 mxf_descriptive_metadata_framework_get_type (void)
626 {
627 - static volatile gsize type = 0;
628 + static gsize type = 0;
629 if (g_once_init_enter (&type)) {
630 GType _type = 0;
631 static const GTypeInfo info = {
632 diff --git a/gst/netsim/gstnetsim.c b/gst/netsim/gstnetsim.c
633 index e0771b83e0..692b3893d2 100644
634 --- a/gst/netsim/gstnetsim.c
635 +++ b/gst/netsim/gstnetsim.c
636 @@ -38,8 +38,8 @@ GST_DEBUG_CATEGORY (netsim_debug);
637 static GType
638 distribution_get_type (void)
639 {
640 - static volatile gsize g_define_type_id__volatile = 0;
641 - if (g_once_init_enter (&g_define_type_id__volatile)) {
642 + static gsize static_g_define_type_id = 0;
643 + if (g_once_init_enter (&static_g_define_type_id)) {
644 static const GEnumValue values[] = {
645 {DISTRIBUTION_UNIFORM, "uniform", "uniform"},
646 {DISTRIBUTION_NORMAL, "normal", "normal"},
647 @@ -48,9 +48,9 @@ distribution_get_type (void)
648 };
649 GType g_define_type_id =
650 g_enum_register_static ("GstNetSimDistribution", values);
651 - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
652 + g_once_init_leave (&static_g_define_type_id, g_define_type_id);
653 }
654 - return g_define_type_id__volatile;
655 + return static_g_define_type_id;
656 }
657
658 enum
659 diff --git a/gst/rtmp2/rtmp/amf.c b/gst/rtmp2/rtmp/amf.c
660 index 69c3768037..f103b91c57 100644
661 --- a/gst/rtmp2/rtmp/amf.c
662 +++ b/gst/rtmp2/rtmp/amf.c
663 @@ -38,7 +38,7 @@ static GBytes *empty_bytes;
664 static void
665 init_static (void)
666 {
667 - static volatile gsize done = 0;
668 + static gsize done = 0;
669 if (g_once_init_enter (&done)) {
670 empty_bytes = g_bytes_new_static ("", 0);
671 GST_DEBUG_CATEGORY_INIT (gst_rtmp_amf_debug_category, "rtmpamf", 0,
672 diff --git a/gst/rtmp2/rtmp/rtmpchunkstream.c b/gst/rtmp2/rtmp/rtmpchunkstream.c
673 index 1cdd68b26d..d3471e76b1 100644
674 --- a/gst/rtmp2/rtmp/rtmpchunkstream.c
675 +++ b/gst/rtmp2/rtmp/rtmpchunkstream.c
676 @@ -31,7 +31,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtmp_chunk_stream_debug_category);
677 static void
678 init_debug (void)
679 {
680 - static volatile gsize done = 0;
681 + static gsize done = 0;
682 if (g_once_init_enter (&done)) {
683 GST_DEBUG_CATEGORY_INIT (gst_rtmp_chunk_stream_debug_category,
684 "rtmpchunkstream", 0, "debug category for rtmp chunk streams");
685 diff --git a/gst/rtmp2/rtmp/rtmpclient.c b/gst/rtmp2/rtmp/rtmpclient.c
686 index d2746ef74e..5a4ffcc812 100644
687 --- a/gst/rtmp2/rtmp/rtmpclient.c
688 +++ b/gst/rtmp2/rtmp/rtmpclient.c
689 @@ -44,7 +44,7 @@ static void on_publish_or_play_status (const gchar * command_name,
690 static void
691 init_debug (void)
692 {
693 - static volatile gsize done = 0;
694 + static gsize done = 0;
695 if (g_once_init_enter (&done)) {
696 GST_DEBUG_CATEGORY_INIT (gst_rtmp_client_debug_category,
697 "rtmpclient", 0, "debug category for the rtmp client");
698 @@ -66,7 +66,7 @@ static const gchar *scheme_strings[] = {
699 GType
700 gst_rtmp_scheme_get_type (void)
701 {
702 - static volatile gsize scheme_type = 0;
703 + static gsize scheme_type = 0;
704 static const GEnumValue scheme[] = {
705 {GST_RTMP_SCHEME_RTMP, "GST_RTMP_SCHEME_RTMP", "rtmp"},
706 {GST_RTMP_SCHEME_RTMPS, "GST_RTMP_SCHEME_RTMPS", "rtmps"},
707 @@ -142,7 +142,7 @@ gst_rtmp_scheme_get_default_port (GstRtmpScheme scheme)
708 GType
709 gst_rtmp_authmod_get_type (void)
710 {
711 - static volatile gsize authmod_type = 0;
712 + static gsize authmod_type = 0;
713 static const GEnumValue authmod[] = {
714 {GST_RTMP_AUTHMOD_NONE, "GST_RTMP_AUTHMOD_NONE", "none"},
715 {GST_RTMP_AUTHMOD_AUTO, "GST_RTMP_AUTHMOD_AUTO", "auto"},
716 @@ -169,7 +169,7 @@ gst_rtmp_authmod_get_nick (GstRtmpAuthmod value)
717 GType
718 gst_rtmp_stop_commands_get_type (void)
719 {
720 - static volatile gsize stop_commands_type = 0;
721 + static gsize stop_commands_type = 0;
722 static const GFlagsValue stop_commands[] = {
723 {GST_RTMP_STOP_COMMANDS_NONE, "No command", "none"},
724 {GST_RTMP_STOP_COMMANDS_FCUNPUBLISH, "FCUnpublish", "fcunpublish"},
725 diff --git a/gst/rtmp2/rtmp/rtmphandshake.c b/gst/rtmp2/rtmp/rtmphandshake.c
726 index 0d821c3d8e..10d0b36981 100644
727 --- a/gst/rtmp2/rtmp/rtmphandshake.c
728 +++ b/gst/rtmp2/rtmp/rtmphandshake.c
729 @@ -34,7 +34,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_rtmp_handshake_debug_category);
730 static void
731 init_debug (void)
732 {
733 - static volatile gsize done = 0;
734 + static gsize done = 0;
735 if (g_once_init_enter (&done)) {
736 GST_DEBUG_CATEGORY_INIT (gst_rtmp_handshake_debug_category, "rtmphandshake",
737 0, "debug category for the rtmp connection handshake");
738 diff --git a/gst/rtmp2/rtmp/rtmpmessage.c b/gst/rtmp2/rtmp/rtmpmessage.c
739 index c117d54d84..f59c09a7da 100644
740 --- a/gst/rtmp2/rtmp/rtmpmessage.c
741 +++ b/gst/rtmp2/rtmp/rtmpmessage.c
742 @@ -146,7 +146,7 @@ gst_rtmp_user_control_type_get_nick (GstRtmpUserControlType type)
743 GType
744 gst_rtmp_meta_api_get_type (void)
745 {
746 - static volatile GType type = 0;
747 + static GType type = 0;
748 static const gchar *tags[] = {
749 NULL
750 };
751 diff --git a/gst/segmentclip/gstsegmentclip.c b/gst/segmentclip/gstsegmentclip.c
752 index 6d002b24f8..167bac4bff 100644
753 --- a/gst/segmentclip/gstsegmentclip.c
754 +++ b/gst/segmentclip/gstsegmentclip.c
755 @@ -56,7 +56,7 @@ static GstElementClass *parent_class;
756 GType
757 gst_segment_clip_get_type (void)
758 {
759 - static volatile gsize segment_clip_type = 0;
760 + static gsize segment_clip_type = 0;
761
762 if (g_once_init_enter (&segment_clip_type)) {
763 GType _type;
764 diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c
765 index 63253e09fd..2c43441307 100644
766 --- a/sys/androidmedia/gstamcaudiodec.c
767 +++ b/sys/androidmedia/gstamcaudiodec.c
768 @@ -90,7 +90,7 @@ static GstAudioDecoderClass *parent_class = NULL;
769 GType
770 gst_amc_audio_dec_get_type (void)
771 {
772 - static volatile gsize type = 0;
773 + static gsize type = 0;
774
775 if (g_once_init_enter (&type)) {
776 GType _type;
777 diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c
778 index 79c2f20f86..79670bd6df 100644
779 --- a/sys/androidmedia/gstamcvideodec.c
780 +++ b/sys/androidmedia/gstamcvideodec.c
781 @@ -263,7 +263,7 @@ static GstVideoDecoderClass *parent_class = NULL;
782 GType
783 gst_amc_video_dec_get_type (void)
784 {
785 - static volatile gsize type = 0;
786 + static gsize type = 0;
787
788 if (g_once_init_enter (&type)) {
789 GType _type;
790 diff --git a/sys/androidmedia/gstamcvideoenc.c b/sys/androidmedia/gstamcvideoenc.c
791 index 8725520c98..591ca35de0 100644
792 --- a/sys/androidmedia/gstamcvideoenc.c
793 +++ b/sys/androidmedia/gstamcvideoenc.c
794 @@ -114,7 +114,7 @@ static GstVideoEncoderClass *parent_class = NULL;
795 GType
796 gst_amc_video_enc_get_type (void)
797 {
798 - static volatile gsize type = 0;
799 + static gsize type = 0;
800
801 if (g_once_init_enter (&type)) {
802 GType _type;
803 diff --git a/sys/applemedia/coremediabuffer.c b/sys/applemedia/coremediabuffer.c
804 index 8f573be39d..70877d77f5 100644
805 --- a/sys/applemedia/coremediabuffer.c
806 +++ b/sys/applemedia/coremediabuffer.c
807 @@ -93,7 +93,7 @@ gst_core_media_meta_transform (GstBuffer * transbuf, GstCoreMediaMeta * meta,
808 GType
809 gst_core_media_meta_api_get_type (void)
810 {
811 - static volatile GType type;
812 + static GType type;
813 static const gchar *tags[] = { "memory", NULL };
814
815 if (g_once_init_enter (&type)) {
816 diff --git a/sys/applemedia/corevideobuffer.c b/sys/applemedia/corevideobuffer.c
817 index 63d737c135..f41685c04f 100644
818 --- a/sys/applemedia/corevideobuffer.c
819 +++ b/sys/applemedia/corevideobuffer.c
820 @@ -80,7 +80,7 @@ gst_core_video_meta_transform (GstBuffer * transbuf, GstCoreVideoMeta * meta,
821 GType
822 gst_core_video_meta_api_get_type (void)
823 {
824 - static volatile GType type;
825 + static GType type;
826 static const gchar *tags[] = { "memory", NULL };
827
828 if (g_once_init_enter (&type)) {
829 diff --git a/sys/applemedia/corevideomemory.c b/sys/applemedia/corevideomemory.c
830 index 5e832d474a..f072d339c9 100644
831 --- a/sys/applemedia/corevideomemory.c
832 +++ b/sys/applemedia/corevideomemory.c
833 @@ -261,7 +261,7 @@ static GstAppleCoreVideoAllocator *_apple_core_video_allocator;
834 void
835 gst_apple_core_video_memory_init (void)
836 {
837 - static volatile gsize _init = 0;
838 + static gsize _init = 0;
839
840 if (g_once_init_enter (&_init)) {
841 GST_DEBUG_CATEGORY_INIT (GST_CAT_APPLE_CORE_VIDEO_MEMORY, "corevideomemory",
842 diff --git a/sys/applemedia/iosglmemory.c b/sys/applemedia/iosglmemory.c
843 index f677efa4c3..7272f1b1f8 100644
844 --- a/sys/applemedia/iosglmemory.c
845 +++ b/sys/applemedia/iosglmemory.c
846 @@ -105,7 +105,7 @@ gst_ios_gl_memory_allocator_init (GstIOSGLMemoryAllocator * allocator)
847 void
848 gst_ios_gl_memory_init (void)
849 {
850 - static volatile gsize _init = 0;
851 + static gsize _init = 0;
852
853 if (g_once_init_enter (&_init)) {
854 GST_DEBUG_CATEGORY_INIT (GST_CAT_IOS_GL_MEMORY, "iosurface", 0,
855 diff --git a/sys/applemedia/iosurfaceglmemory.c b/sys/applemedia/iosurfaceglmemory.c
856 index 56e5bad031..d37e6e223e 100644
857 --- a/sys/applemedia/iosurfaceglmemory.c
858 +++ b/sys/applemedia/iosurfaceglmemory.c
859 @@ -141,7 +141,7 @@ gst_io_surface_gl_memory_allocator_init (GstIOSurfaceGLMemoryAllocator *
860 void
861 gst_ios_surface_gl_memory_init (void)
862 {
863 - static volatile gsize _init = 0;
864 + static gsize _init = 0;
865
866 if (g_once_init_enter (&_init)) {
867 GST_DEBUG_CATEGORY_INIT (GST_CAT_IO_SURFACE_GL_MEMORY, "iosurfacegl", 0,
868 diff --git a/sys/applemedia/iosurfacevulkanmemory.c b/sys/applemedia/iosurfacevulkanmemory.c
869 index b237cfb55d..2bf2e5da76 100644
870 --- a/sys/applemedia/iosurfacevulkanmemory.c
871 +++ b/sys/applemedia/iosurfacevulkanmemory.c
872 @@ -114,7 +114,7 @@ gst_io_surface_vulkan_memory_allocator_init (GstIOSurfaceVulkanMemoryAllocator *
873 void
874 gst_io_surface_vulkan_memory_init (void)
875 {
876 - static volatile gsize _init = 0;
877 + static gsize _init = 0;
878
879 if (g_once_init_enter (&_init)) {
880 GST_DEBUG_CATEGORY_INIT (GST_CAT_IO_SURFACE_VULKAN_MEMORY,
881 diff --git a/sys/bluez/gstavdtpsrc.h b/sys/bluez/gstavdtpsrc.h
882 index 34a2697f20..57e26493fa 100644
883 --- a/sys/bluez/gstavdtpsrc.h
884 +++ b/sys/bluez/gstavdtpsrc.h
885 @@ -59,7 +59,7 @@ struct _GstAvdtpSrc
886
887 GstPoll *poll;
888 GstPollFD pfd;
889 - volatile gint unlocked;
890 + gint unlocked;
891
892 GstClockTime duration;
893
894 diff --git a/sys/d3d11/gstd3d11decoder.c b/sys/d3d11/gstd3d11decoder.c
895 index f88f3447b2..bc8c1f3a7e 100644
896 --- a/sys/d3d11/gstd3d11decoder.c
897 +++ b/sys/d3d11/gstd3d11decoder.c
898 @@ -109,7 +109,7 @@ struct _GstD3D11DecoderPrivate
899 static GQuark
900 _decoder_output_view_get (void)
901 {
902 - static volatile gsize g_quark = 0;
903 + static gsize g_quark = 0;
904
905 if (g_once_init_enter (&g_quark)) {
906 gsize quark =
907 diff --git a/sys/d3d11/gstd3d11device.c b/sys/d3d11/gstd3d11device.c
908 index 0641e5a500..f91ebe5b70 100644
909 --- a/sys/d3d11/gstd3d11device.c
910 +++ b/sys/d3d11/gstd3d11device.c
911 @@ -111,7 +111,7 @@ static void gst_d3d11_device_finalize (GObject * object);
912 static gboolean
913 gst_d3d11_device_enable_d3d11_debug (void)
914 {
915 - static volatile gsize _init = 0;
916 + static gsize _init = 0;
917
918 /* If all below libraries are unavailable, d3d11 device would fail with
919 * D3D11_CREATE_DEVICE_DEBUG flag */
920 @@ -199,7 +199,7 @@ gst_d3d11_device_d3d11_debug (GstD3D11Device * device,
921 static gboolean
922 gst_d3d11_device_enable_dxgi_debug (void)
923 {
924 - static volatile gsize _init = 0;
925 + static gsize _init = 0;
926 gboolean ret = FALSE;
927
928 /* If all below libraries are unavailable, d3d11 device would fail with
929 diff --git a/sys/d3d11/gstd3d11shader.c b/sys/d3d11/gstd3d11shader.c
930 index cbd3c69e40..835b7ccad7 100644
931 --- a/sys/d3d11/gstd3d11shader.c
932 +++ b/sys/d3d11/gstd3d11shader.c
933 @@ -35,7 +35,7 @@ static pD3DCompile GstD3DCompileFunc = NULL;
934 gboolean
935 gst_d3d11_shader_init (void)
936 {
937 - static volatile gsize _init = 0;
938 + static gsize _init = 0;
939
940 if (g_once_init_enter (&_init)) {
941 #if GST_D3D11_WINAPI_ONLY_APP
942 diff --git a/sys/d3d11/gstd3d11utils.c b/sys/d3d11/gstd3d11utils.c
943 index 1d4d30d539..4cb0ae6299 100644
944 --- a/sys/d3d11/gstd3d11utils.c
945 +++ b/sys/d3d11/gstd3d11utils.c
946 @@ -34,7 +34,7 @@ GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_utils_debug);
947 static void
948 _init_context_debug (void)
949 {
950 - static volatile gsize _init = 0;
951 + static gsize _init = 0;
952
953 if (g_once_init_enter (&_init)) {
954 GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
955 diff --git a/sys/d3d11/gstd3d11videoprocessor.c b/sys/d3d11/gstd3d11videoprocessor.c
956 index 94e601dfe5..781592218b 100644
957 --- a/sys/d3d11/gstd3d11videoprocessor.c
958 +++ b/sys/d3d11/gstd3d11videoprocessor.c
959 @@ -43,7 +43,7 @@ GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_video_processor_debug);
960 GQuark
961 gst_d3d11_video_processor_input_view_quark (void)
962 {
963 - static volatile gsize quark = 0;
964 + static gsize quark = 0;
965
966 if (g_once_init_enter (&quark)) {
967 GQuark q = g_quark_from_static_string ("GstD3D11VideoProcessorInputView");
968 @@ -56,7 +56,7 @@ gst_d3d11_video_processor_input_view_quark (void)
969 GQuark
970 gst_d3d11_video_processor_output_view_quark (void)
971 {
972 - static volatile gsize quark = 0;
973 + static gsize quark = 0;
974
975 if (g_once_init_enter (&quark)) {
976 GQuark q = g_quark_from_static_string ("GstD3D11VideoProcessorOutputView");
977 diff --git a/sys/d3d11/gstd3d11window.cpp b/sys/d3d11/gstd3d11window.cpp
978 index ab98419466..6f827e3c7d 100644
979 --- a/sys/d3d11/gstd3d11window.cpp
980 +++ b/sys/d3d11/gstd3d11window.cpp
981 @@ -73,7 +73,7 @@ static guint d3d11_window_signals[SIGNAL_LAST] = { 0, };
982 GType
983 gst_d3d11_window_fullscreen_toggle_mode_type (void)
984 {
985 - static volatile gsize mode_type = 0;
986 + static gsize mode_type = 0;
987
988 if (g_once_init_enter (&mode_type)) {
989 static const GFlagsValue mode_types[] = {
990 diff --git a/sys/d3d11/gstd3d11window_win32.cpp b/sys/d3d11/gstd3d11window_win32.cpp
991 index 012ce6a0b8..de564d9519 100644
992 --- a/sys/d3d11/gstd3d11window_win32.cpp
993 +++ b/sys/d3d11/gstd3d11window_win32.cpp
994 @@ -80,7 +80,7 @@ struct _GstD3D11WindowWin32
995 gboolean have_swapchain1;
996
997 /* atomic */
998 - volatile gint pending_fullscreen_count;
999 + gint pending_fullscreen_count;
1000
1001 /* fullscreen related */
1002 RECT restore_rect;
1003 diff --git a/sys/ipcpipeline/gstipcpipelinecomm.c b/sys/ipcpipeline/gstipcpipelinecomm.c
1004 index 9176f49624..3dde66004b 100644
1005 --- a/sys/ipcpipeline/gstipcpipelinecomm.c
1006 +++ b/sys/ipcpipeline/gstipcpipelinecomm.c
1007 @@ -2318,7 +2318,7 @@ G_STMT_START { \
1008 void
1009 gst_ipc_pipeline_comm_plugin_init (void)
1010 {
1011 - static volatile gsize once = 0;
1012 + static gsize once = 0;
1013
1014 if (g_once_init_enter (&once)) {
1015 GST_DEBUG_CATEGORY_INIT (gst_ipc_pipeline_comm_debug, "ipcpipelinecomm", 0,
1016 diff --git a/sys/msdk/gstmsdkcontextutil.c b/sys/msdk/gstmsdkcontextutil.c
1017 index 6f5c7e41d7..0cd24eb4ba 100644
1018 --- a/sys/msdk/gstmsdkcontextutil.c
1019 +++ b/sys/msdk/gstmsdkcontextutil.c
1020 @@ -38,7 +38,7 @@ static void
1021 _init_context_debug (void)
1022 {
1023 #ifndef GST_DISABLE_GST_DEBUG
1024 - static volatile gsize _init = 0;
1025 + static gsize _init = 0;
1026
1027 if (g_once_init_enter (&_init)) {
1028 GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
1029 diff --git a/sys/nvcodec/gstcudacontext.c b/sys/nvcodec/gstcudacontext.c
1030 index b6406f6873..35b03cf399 100644
1031 --- a/sys/nvcodec/gstcudacontext.c
1032 +++ b/sys/nvcodec/gstcudacontext.c
1033 @@ -121,7 +121,7 @@ gst_cuda_context_get_property (GObject * object, guint prop_id,
1034 static void
1035 gst_cuda_context_constructed (GObject * object)
1036 {
1037 - static volatile gsize once = 0;
1038 + static gsize once = 0;
1039 GstCudaContext *context = GST_CUDA_CONTEXT (object);
1040 GstCudaContextPrivate *priv = context->priv;
1041 CUcontext cuda_ctx, old_ctx;
1042 diff --git a/sys/nvcodec/gstcudautils.c b/sys/nvcodec/gstcudautils.c
1043 index 052590209c..6d33bc484e 100644
1044 --- a/sys/nvcodec/gstcudautils.c
1045 +++ b/sys/nvcodec/gstcudautils.c
1046 @@ -36,7 +36,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
1047 static void
1048 _init_debug (void)
1049 {
1050 - static volatile gsize once_init = 0;
1051 + static gsize once_init = 0;
1052
1053 if (g_once_init_enter (&once_init)) {
1054
1055 @@ -354,7 +354,7 @@ static GQuark gst_cuda_quark_table[GST_CUDA_QUARK_MAX];
1056 static void
1057 init_cuda_quark_once (void)
1058 {
1059 - static volatile gsize once_init = 0;
1060 + static gsize once_init = 0;
1061
1062 if (g_once_init_enter (&once_init)) {
1063 gint i;
1064 diff --git a/sys/nvcodec/gstnvbaseenc.h b/sys/nvcodec/gstnvbaseenc.h
1065 index e9b2fe15e0..069cd28ebc 100644
1066 --- a/sys/nvcodec/gstnvbaseenc.h
1067 +++ b/sys/nvcodec/gstnvbaseenc.h
1068 @@ -111,7 +111,7 @@ typedef struct {
1069 GValue * input_formats; /* OBJECT LOCK */
1070
1071 GstVideoCodecState *input_state;
1072 - volatile gint reconfig; /* ATOMIC */
1073 + gint reconfig; /* ATOMIC */
1074 gboolean gl_input;
1075
1076 /* array of allocated input/output buffers (GstNvEncFrameState),
1077 diff --git a/sys/opensles/openslescommon.c b/sys/opensles/openslescommon.c
1078 index 7dc4bb81f8..72cfc9d5da 100644
1079 --- a/sys/opensles/openslescommon.c
1080 +++ b/sys/opensles/openslescommon.c
1081 @@ -42,7 +42,7 @@ gst_opensles_recording_preset_get_type (void)
1082 "voice-communication"},
1083 {0, NULL, NULL}
1084 };
1085 - static volatile GType id = 0;
1086 + static GType id = 0;
1087
1088 if (g_once_init_enter ((gsize *) & id)) {
1089 GType _id;
1090 @@ -100,7 +100,7 @@ gst_opensles_stream_type_get_type (void)
1091 "GST_OPENSLES_STREAM_TYPE_NONE", "none"},
1092 {0, NULL, NULL}
1093 };
1094 - static volatile GType id = 0;
1095 + static GType id = 0;
1096
1097 if (g_once_init_enter ((gsize *) & id)) {
1098 GType _id;
1099 diff --git a/sys/va/gstvaallocator.c b/sys/va/gstvaallocator.c
1100 index cd42ffb53a..f003b1fba8 100644
1101 --- a/sys/va/gstvaallocator.c
1102 +++ b/sys/va/gstvaallocator.c
1103 @@ -56,14 +56,14 @@ struct _GstVaBufferSurface
1104 {
1105 GstVideoInfo info;
1106 VASurfaceID surface;
1107 - volatile gint ref_count;
1108 + gint ref_count;
1109 };
1110
1111 static void
1112 _init_debug_category (void)
1113 {
1114 #ifndef GST_DISABLE_GST_DEBUG
1115 - static volatile gsize _init = 0;
1116 + static gsize _init = 0;
1117
1118 if (g_once_init_enter (&_init)) {
1119 GST_DEBUG_CATEGORY_INIT (gst_va_memory_debug, "vamemory", 0, "VA memory");
1120 @@ -573,7 +573,7 @@ struct _GstVaMemory
1121 gpointer mapped_data;
1122
1123 GstMapFlags prev_mapflags;
1124 - volatile gint map_count;
1125 + gint map_count;
1126
1127 gboolean is_derived;
1128 gboolean is_dirty;
1129 diff --git a/sys/va/gstvautils.c b/sys/va/gstvautils.c
1130 index 95bfaee44b..ad2ad22fc8 100644
1131 --- a/sys/va/gstvautils.c
1132 +++ b/sys/va/gstvautils.c
1133 @@ -32,7 +32,7 @@ static void
1134 _init_context_debug (void)
1135 {
1136 #ifndef GST_DISABLE_GST_DEBUG
1137 - static volatile gsize _init = 0;
1138 + static gsize _init = 0;
1139
1140 if (g_once_init_enter (&_init)) {
1141 GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
1142 diff --git a/sys/wasapi/gstwasapiutil.c b/sys/wasapi/gstwasapiutil.c
1143 index 61076df842..5d7ff38c4c 100644
1144 --- a/sys/wasapi/gstwasapiutil.c
1145 +++ b/sys/wasapi/gstwasapiutil.c
1146 @@ -144,7 +144,7 @@ gst_wasapi_device_role_get_type (void)
1147 {GST_WASAPI_DEVICE_ROLE_COMMS, "Voice communications", "comms"},
1148 {0, NULL, NULL}
1149 };
1150 - static volatile GType id = 0;
1151 + static GType id = 0;
1152
1153 if (g_once_init_enter ((gsize *) & id)) {
1154 GType _id;
1155 diff --git a/sys/wasapi2/gstwasapi2client.cpp b/sys/wasapi2/gstwasapi2client.cpp
1156 index 390bedf2c7..666b929697 100644
1157 --- a/sys/wasapi2/gstwasapi2client.cpp
1158 +++ b/sys/wasapi2/gstwasapi2client.cpp
1159 @@ -277,7 +277,7 @@ struct _GstWasapi2Client
1160 GType
1161 gst_wasapi2_client_device_class_get_type (void)
1162 {
1163 - static volatile GType class_type = 0;
1164 + static GType class_type = 0;
1165 static const GEnumValue types[] = {
1166 {GST_WASAPI2_CLIENT_DEVICE_CLASS_CAPTURE, "Capture", "capture"},
1167 {GST_WASAPI2_CLIENT_DEVICE_CLASS_RENDER, "Render", "render"},
1168 diff --git a/sys/winscreencap/dxgicapture.c b/sys/winscreencap/dxgicapture.c
1169 index 07c30dc702..4b17e5e897 100644
1170 --- a/sys/winscreencap/dxgicapture.c
1171 +++ b/sys/winscreencap/dxgicapture.c
1172 @@ -166,7 +166,7 @@ static pD3DCompile GstD3DCompileFunc = NULL;
1173 gboolean
1174 gst_dxgicap_shader_init (void)
1175 {
1176 - static volatile gsize _init = 0;
1177 + static gsize _init = 0;
1178 static const gchar *d3d_compiler_names[] = {
1179 "d3dcompiler_47.dll",
1180 "d3dcompiler_46.dll",
1181 diff --git a/tests/check/libs/vkimage.c b/tests/check/libs/vkimage.c
1182 index 09999b739c..6ef279b099 100644
1183 --- a/tests/check/libs/vkimage.c
1184 +++ b/tests/check/libs/vkimage.c
1185 @@ -149,7 +149,7 @@ struct view_stress
1186 GMutex lock;
1187 GCond cond;
1188 gboolean ready;
1189 - volatile int n_ops;
1190 + int n_ops;
1191 GQueue *memories;
1192 GstHarnessThread *threads[N_THREADS];
1193 };
1194 @@ -189,7 +189,7 @@ GST_START_TEST (test_image_view_stress)
1195 g_mutex_init (&stress.lock);
1196 g_cond_init (&stress.cond);
1197 stress.ready = FALSE;
1198 - stress.n_ops = 0;
1199 + g_atomic_int_set (&stress.n_ops, 0);
1200 stress.memories = g_queue_new ();
1201
1202 gst_video_info_set_format (&v_info, GST_VIDEO_FORMAT_RGBA, 16, 16);
1203 --
1204 GitLab
|