[vlc-commits] mmal: deinterlace: do the chroma checks early

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jan 10 16:06:06 2020 +0100| [5eaf6e2c467cec5c8555f0b04ba71eb227e8781b] | committer: Steve Lhomme

mmal: deinterlace: do the chroma checks early

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

 modules/hw/mmal/deinterlace.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index 4a62912e0b..fb67d7f034 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -87,6 +87,12 @@ static void flush(filter_t *filter);
 static int Open(vlc_object_t *obj)
 {
     filter_t *filter = (filter_t *)obj;
+    if (filter->fmt_in.video.i_chroma != VLC_CODEC_MMAL_OPAQUE)
+        return VLC_EGENERIC;
+
+    if (filter->fmt_out.video.i_chroma != VLC_CODEC_MMAL_OPAQUE)
+        return VLC_EGENERIC;
+
     int32_t frame_duration = filter->fmt_in.video.i_frame_rate != 0 ?
             vlc_tick_from_samples( filter->fmt_in.video.i_frame_rate_base,
             filter->fmt_in.video.i_frame_rate ) : 0;
@@ -106,12 +112,6 @@ static int Open(vlc_object_t *obj)
     msg_Dbg(filter, "Try to open mmal_deinterlace filter. frame_duration: %d, QPU %s!",
             frame_duration, use_qpu ? "used" : "unused");
 
-    if (filter->fmt_in.video.i_chroma != VLC_CODEC_MMAL_OPAQUE)
-        return VLC_EGENERIC;
-
-    if (filter->fmt_out.video.i_chroma != VLC_CODEC_MMAL_OPAQUE)
-        return VLC_EGENERIC;
-
     sys = calloc(1, sizeof(filter_sys_t));
     if (!sys)
         return VLC_ENOMEM;
@@ -267,9 +267,6 @@ static void Close(vlc_object_t *obj)
     filter_sys_t *sys = filter->p_sys;
     MMAL_BUFFER_HEADER_T *buffer;
 
-    if (!sys)
-        return;
-
     if (sys->component && sys->component->control->is_enabled)
         mmal_port_disable(sys->component->control);
 



More information about the vlc-commits mailing list