[vlc-devel] [PATCH 03/14] mmal/codec: Clear data from buffer header before release

Julian Scheel julian at jusst.de
Wed Jun 3 09:50:28 CEST 2015


The data attached to the output port headers is not owned by the codec but by
the vout and only temporarily attached to the codecs buffers. To avoid
refcount issues within the mmal core clear the data field before releasing the
buffers.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 modules/hw/mmal/codec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/hw/mmal/codec.c b/modules/hw/mmal/codec.c
index 6dd6e1a..dfe916a 100644
--- a/modules/hw/mmal/codec.c
+++ b/modules/hw/mmal/codec.c
@@ -460,6 +460,7 @@ static int send_output_buffer(decoder_t *dec)
 err:
     if (picture)
         picture_Release(picture);
+    buffer->data = NULL;
     mmal_buffer_header_release(buffer);
     return ret;
 }
@@ -549,6 +550,7 @@ static picture_t *decode(decoder_t *dec, block_t **pblock)
             ret->b_progressive = sys->b_progressive;
             ret->b_top_field_first = sys->b_top_field_first;
 
+            buffer->data = NULL;
             mmal_buffer_header_reset(buffer);
             mmal_buffer_header_release(buffer);
         }
-- 
2.4.0





More information about the vlc-devel mailing list