[vlc-commits] mmal: codec: make the started boolean non atomic

Steve Lhomme git at videolan.org
Fri Jan 10 16:42:35 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 10 14:53:12 2020 +0100| [2b2cea973b2ac91157536425054b1418ec56e764] | committer: Steve Lhomme

mmal: codec: make the started boolean non atomic

It's only used by the dec->pf_decode callback which only occurs in one thread.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b2cea973b2ac91157536425054b1418ec56e764
---

 modules/hw/mmal/codec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index ed3cb96d68..166f7b9393 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -80,7 +80,7 @@ typedef struct
     /* statistics */
     int output_in_transit;
     int input_in_transit;
-    atomic_bool started;
+    bool started;
 } decoder_sys_t;
 
 /* Utilities */
@@ -289,7 +289,7 @@ static int change_output_format(decoder_t *dec)
     int pool_size;
     int ret = 0;
 
-    if (atomic_load(&sys->started)) {
+    if (sys->started) {
         mmal_format_full_copy(sys->output->format, sys->output_format);
         status = mmal_port_format_commit(sys->output);
         if (status == MMAL_SUCCESS)
@@ -334,13 +334,13 @@ static int change_output_format(decoder_t *dec)
         return -1;
     }
 
-    if (!atomic_load(&sys->started)) {
+    if (!sys->started) {
         if (!sys->opaque) {
             sys->output_pool = mmal_port_pool_create(sys->output, pool_size, 0);
             msg_Dbg(dec, "Created output pool with %d pictures", sys->output_pool->headers_num);
         }
 
-        atomic_store(&sys->started, true);
+        sys->started = true;
 
         /* we need one picture from vout for each buffer header on the output
          * port */
@@ -546,7 +546,7 @@ static int decode(decoder_t *dec, block_t *block)
         return VLCDEC_SUCCESS;
     }
 
-    if (atomic_load(&sys->started))
+    if (sys->started)
         fill_output_port(dec);
 
     /*



More information about the vlc-commits mailing list