[vlc-commits] mmal/codec: Fix flushing

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


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

mmal/codec: Fix flushing

There is no reason to disable ports before flushing, neither is there a
reason to reconfigure the port after flushing. In fact this lead to
weird issues with the whole mmal stack when the codec was flushed.

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=0b5d6e1b8fead8d909988fb3c6c4eb1a1952559c
---

 modules/hw/mmal/codec.c | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 39d3835456..88ae5e2e60 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -537,36 +537,9 @@ static void flush_decoder(decoder_t *dec)
     MMAL_STATUS_T status;
 
     msg_Dbg(dec, "Flushing decoder ports...");
-    mmal_port_disable(sys->output);
-    mmal_port_disable(sys->input);
     mmal_port_flush(sys->output);
     mmal_port_flush(sys->input);
 
-    /* Reload extradata if available */
-    if (dec->fmt_in.i_codec == VLC_CODEC_H264) {
-        if (dec->fmt_in.i_extra > 0) {
-            status = mmal_format_extradata_alloc(sys->input->format,
-                    dec->fmt_in.i_extra);
-            if (status == MMAL_SUCCESS) {
-                memcpy(sys->input->format->extradata, dec->fmt_in.p_extra,
-                        dec->fmt_in.i_extra);
-                sys->input->format->extradata_size = dec->fmt_in.i_extra;
-            } else {
-                msg_Err(dec, "Failed to allocate extra format data on input port %s (status=%"PRIx32" %s)",
-                        sys->input->name, status, mmal_status_to_string(status));
-            }
-        }
-    }
-
-    status = mmal_port_format_commit(sys->input);
-    if (status != MMAL_SUCCESS) {
-        msg_Err(dec, "Failed to commit format for input port %s (status=%"PRIx32" %s)",
-                sys->input->name, status, mmal_status_to_string(status));
-    }
-
-    mmal_port_enable(sys->output, output_port_cb);
-    mmal_port_enable(sys->input, input_port_cb);
-
     while (atomic_load(&sys->output_in_transit))
         vlc_sem_wait(&sys->sem);
 



More information about the vlc-commits mailing list