]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/buffer_internal.h
Merge commit 'e7e5be8635c1cf0588d2a07e59374135de6da55a'
[ffmpeg] / libavutil / buffer_internal.h
index 29ce8a643c0a4234c58f0cab77092661b12cf16e..54b67047e5e54d8ea54ca0567c067ea42200832a 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef AVUTIL_BUFFER_INTERNAL_H
 #define AVUTIL_BUFFER_INTERNAL_H
 
+#include <stdatomic.h>
 #include <stdint.h>
 
 #include "buffer.h"
@@ -40,7 +41,7 @@ struct AVBuffer {
     /**
      *  number of existing AVBufferRef instances referring to this buffer
      */
-    volatile int refcount;
+    atomic_uint refcount;
 
     /**
      * a callback for freeing the data
@@ -85,9 +86,7 @@ struct AVBufferPool {
      * buffers have been released, then it's safe to free the pool and all
      * the buffers in it.
      */
-    volatile int refcount;
-
-    volatile int nb_allocated;
+    atomic_uint refcount;
 
     int size;
     void *opaque;