diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-17 16:37:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-17 18:40:15 +0100 |
commit | e3be7b11592994139a9649d5750654ddfb4e7059 (patch) | |
tree | b1406a63a9e767113b27f69e3bff0297c3042f3b /libavutil/buffer.c | |
parent | 9cde9f70ab482287d892cac20679f40a6673baa8 (diff) | |
download | ffmpeg-e3be7b11592994139a9649d5750654ddfb4e7059.tar.gz |
avutil/get_pool: Remove redundant initial atomic operation
602->442 dezicycles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/buffer.c')
-rw-r--r-- | libavutil/buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavutil/buffer.c b/libavutil/buffer.c index d268a7f604..3475e57b4a 100644 --- a/libavutil/buffer.c +++ b/libavutil/buffer.c @@ -239,14 +239,14 @@ void av_buffer_pool_uninit(AVBufferPool **ppool) /* remove the whole buffer list from the pool and return it */ static BufferPoolEntry *get_pool(AVBufferPool *pool) { - BufferPoolEntry *cur = NULL, *last = NULL; + BufferPoolEntry *cur = *(void * volatile *)&pool->pool, *last = NULL; - do { + while (cur != last) { FFSWAP(BufferPoolEntry*, cur, last); cur = avpriv_atomic_ptr_cas((void * volatile *)&pool->pool, last, NULL); if (!cur) return NULL; - } while (cur != last); + } return cur; } |