[vlc-commits] mmal: codec: clean the new output format once it's handled

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


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

mmal: codec: clean the new output format once it's handled

It's easier to read it when it's cleaned right after being used.

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

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

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 5294c61e2f..b7c8b283fe 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -391,9 +391,6 @@ apply_fmt:
     }
 
 out:
-    mmal_format_free(sys->output_format);
-    sys->output_format = NULL;
-
     return ret;
 }
 
@@ -539,6 +536,8 @@ static int decode(decoder_t *dec, block_t *block)
     if (sys->output_format) {
         if (change_output_format(dec) < 0)
             msg_Err(dec, "Failed to change output port format");
+        mmal_format_free(sys->output_format);
+        sys->output_format = NULL;
     }
 
     if (!block)



More information about the vlc-commits mailing list