[vlc-commits] mmal/deinterlace: Always flush mmal on flush

Julian Scheel git at videolan.org
Thu Oct 19 11:38:41 CEST 2017


vlc | branch: master | Julian Scheel <julian at jusst.de> | Thu Oct 19 11:23:03 2017 +0200| [796a027b1be141f0f0ba65ef2d69c1caaebf8b9d] | committer: Jean-Baptiste Kempf

mmal/deinterlace: Always flush mmal on flush

Do not only flush if buffers are in transit, but whenever flush is
called. This is necessary because the deinterlace filter has an internal
state (reference pictures) which is reset on mmal_port_flush as well.

Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/hw/mmal/deinterlace.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index ad75297e5c..ff7643e2b9 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -409,19 +409,15 @@ static void flush(filter_t *filter)
 
     msg_Dbg(filter, "flush deinterlace filter");
 
-    if (atomic_load(&sys->input_in_transit) ||
-            atomic_load(&sys->output_in_transit)) {
-
-        msg_Dbg(filter, "flush: flush ports (input: %d, output: %d in transit)",
-                sys->input_in_transit, sys->output_in_transit);
-        mmal_port_flush(sys->output);
-        mmal_port_flush(sys->input);
-
-        msg_Dbg(filter, "flush: wait for all buffers to be returned");
-        while (atomic_load(&sys->input_in_transit) ||
-                atomic_load(&sys->output_in_transit))
-            vlc_sem_wait(&sys->sem);
-    }
+    msg_Dbg(filter, "flush: flush ports (input: %d, output: %d in transit)",
+            sys->input_in_transit, sys->output_in_transit);
+    mmal_port_flush(sys->output);
+    mmal_port_flush(sys->input);
+
+    msg_Dbg(filter, "flush: wait for all buffers to be returned");
+    while (atomic_load(&sys->input_in_transit) ||
+            atomic_load(&sys->output_in_transit))
+        vlc_sem_wait(&sys->sem);
 
     while ((buffer = mmal_queue_get(sys->filtered_pictures))) {
         picture_t *pic = (picture_t *)buffer->user_data;
@@ -429,6 +425,7 @@ static void flush(filter_t *filter)
                 (void *)pic);
         picture_Release(pic);
     }
+    atomic_store(&sys->started, false);
     msg_Dbg(filter, "flush: done");
 }
 



More information about the vlc-commits mailing list