[vlc-commits] mmal/deinterlace: Allocate extra buffers

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


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

mmal/deinterlace: Allocate extra buffers

The image_fx plugin has an internal pool of allocated buffers which are
used to render filtered pictures into. This must be big enough to avoid
running out of buffers when vlc core holds pictures in it's queue before
rendering them. For this allocate 5 extra buffers.

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=84db048da1ece31c8dc23bf1c5b8a89953ebb678
---

 modules/hw/mmal/deinterlace.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/modules/hw/mmal/deinterlace.c b/modules/hw/mmal/deinterlace.c
index ff7643e2b9..c56f0f2969 100644
--- a/modules/hw/mmal/deinterlace.c
+++ b/modules/hw/mmal/deinterlace.c
@@ -197,6 +197,17 @@ static int Open(filter_t *filter)
     sys->output->buffer_num = 3;
 
     if (filter->fmt_in.i_codec == VLC_CODEC_MMAL_OPAQUE) {
+        MMAL_PARAMETER_UINT32_T extra_buffers = {
+            { MMAL_PARAMETER_EXTRA_BUFFERS, sizeof(MMAL_PARAMETER_UINT32_T) },
+            5
+        };
+        status = mmal_port_parameter_set(sys->output, &extra_buffers.hdr);
+        if (status != MMAL_SUCCESS) {
+            msg_Err(filter, "Failed to set MMAL_PARAMETER_EXTRA_BUFFERS on output port (status=%"PRIx32" %s)",
+                    status, mmal_status_to_string(status));
+            goto out;
+        }
+
         MMAL_PARAMETER_BOOLEAN_T zero_copy = {
             { MMAL_PARAMETER_ZERO_COPY, sizeof(MMAL_PARAMETER_BOOLEAN_T) },
             1



More information about the vlc-commits mailing list