]> git.sesse.net Git - ffmpeg/commitdiff
avutil/opencl: Fix volatile pointer
authorTimo Rothenpieler <timo@rothenpieler.org>
Thu, 24 Sep 2015 14:58:30 +0000 (16:58 +0200)
committerTimo Rothenpieler <timo@rothenpieler.org>
Sat, 26 Sep 2015 18:28:29 +0000 (20:28 +0200)
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
libavutil/opencl.c

index 1d782145881fc23be316b2a0ba5848917e58f7a1..868649321f32678ade8435a8c8e5e180cbd907b4 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 #include "atomic.h"
 
-static volatile pthread_mutex_t *atomic_opencl_lock = NULL;
+static pthread_mutex_t * volatile atomic_opencl_lock = NULL;
 #define LOCK_OPENCL pthread_mutex_lock(atomic_opencl_lock)
 #define UNLOCK_OPENCL pthread_mutex_unlock(atomic_opencl_lock)
 #else
@@ -363,7 +363,7 @@ static inline int init_opencl_mtx(void)
             av_free(tmp);
             return AVERROR(err);
         }
-        if (avpriv_atomic_ptr_cas(&atomic_opencl_lock, NULL, tmp)) {
+        if (avpriv_atomic_ptr_cas((void * volatile *)&atomic_opencl_lock, NULL, tmp)) {
             pthread_mutex_destroy(tmp);
             av_free(tmp);
         }