From b9b3c88b3aa5819c32b900519a929eb14211b512 Mon Sep 17 00:00:00 2001 From: Jeegar Patel Date: Tue, 31 Jan 2017 17:26:34 +0530 Subject: [PATCH 22/24] Fixing some errors related to unref In encoder/decoder when pipeline ends, unref happen one more time so it gives error, Now fixed that error by keeping some check Signed-off-by: Jeegar Patel Upstream Status: Pending --- omx/gstomx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/omx/gstomx.c b/omx/gstomx.c index ef2deb2..e2b781c 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -620,18 +620,21 @@ EmptyBufferDone (OMX_HANDLETYPE hComponent, OMX_PTR pAppData, self_enc = comp->parent; if (self_enc != NULL) { if (self_enc->input_mode == OMX_Enc_InputMode_DMABufImport) { - if (buf->port->index == 0) { + if ((buf->port->index == 0) && (buf->input_buffer != NULL)) { gst_buffer_unref (buf->input_buffer); + buf->input_buffer = NULL; } } else if (self_enc->input_mode == OMX_Enc_InputMode_ZeroCopy) { - if (buf->port->index == 0) { + if ((buf->port->index == 0) && (buf->input_buffer != NULL)) { gst_buffer_unref (buf->input_buffer); + buf->input_buffer = NULL; } } } } else if (!strcmp (comp->name, "decoder")) { - if (buf->port->index == 0) { + if ((buf->port->index == 0) && (buf->input_buffer != NULL)) { gst_buffer_unref (buf->input_buffer); + buf->input_buffer = NULL; } } gst_omx_component_send_message (comp, msg); -- 2.7.4