[FFmpeg-cvslog] buffer: use the atomic get instead of the add and fetch variant.

Clément Bœsch git at videolan.org
Tue Mar 12 12:13:03 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Tue Mar 12 08:31:28 2013 +0100| [80661e0f5586dfa561a3eb461464530c74a58b1d] | committer: Clément Bœsch

buffer: use the atomic get instead of the add and fetch variant.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80661e0f5586dfa561a3eb461464530c74a58b1d
---

 libavutil/buffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index 21e102d..d268a7f 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -122,7 +122,7 @@ int av_buffer_is_writable(const AVBufferRef *buf)
     if (buf->buffer->flags & AV_BUFFER_FLAG_READONLY)
         return 0;
 
-    return avpriv_atomic_int_add_and_fetch(&buf->buffer->refcount, 0) == 1;
+    return avpriv_atomic_int_get(&buf->buffer->refcount) == 1;
 }
 
 int av_buffer_make_writable(AVBufferRef **pbuf)



More information about the ffmpeg-cvslog mailing list