mmaldec: initialize refcount using atomic_init()
authorWan-Teh Chang <wtc@google.com>
Wed, 30 Nov 2016 19:52:41 +0000 (11:52 -0800)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 2 Dec 2016 17:16:26 +0000 (12:16 -0500)
This is how we initialize refcount in libavutil/buffer.c.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/mmaldec.c

index 924bfb2..e64ddba 100644 (file)
@@ -281,7 +281,7 @@ static int ffmal_update_format(AVCodecContext *avctx)
         ret = AVERROR(ENOMEM);
         goto fail;
     }
-    atomic_store(&ctx->pool_out->refcount, 1);
+    atomic_init(&ctx->pool_out->refcount, 1);
 
     if (!format_out)
         goto fail;