[vlc-devel] [PATCH 9/9] mmal/deinterlace: Allocate extra buffers

Julian Scheel julian at jusst.de
Thu Oct 19 11:23:06 CEST 2017


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>
---
 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
-- 
2.14.2



More information about the vlc-devel mailing list