From 9f136a667d459d22e925ffb27e851b7ea6e89228 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 11 Jan 2012 12:58:08 +0100 Subject: [PATCH] faac: fix some input and output buffer map and ref handling --- ext/faac/gstfaac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c index ecae7da8ad..a44d886f44 100644 --- a/ext/faac/gstfaac.c +++ b/ext/faac/gstfaac.c @@ -672,7 +672,8 @@ gst_faac_handle_frame (GstAudioEncoder * enc, GstBuffer * in_buf) size / (info->finfo->width / 8), out_data, out_size)) < 0)) goto encode_failed; - gst_buffer_unmap (in_buf, data, size); + if (in_buf) + gst_buffer_unmap (in_buf, data, -1); GST_LOG_OBJECT (faac, "encoder return: %" G_GSIZE_FORMAT, ret_size); @@ -696,9 +697,9 @@ gst_faac_handle_frame (GstAudioEncoder * enc, GstBuffer * in_buf) /* ERRORS */ encode_failed: { - gst_buffer_unref (out_buf); GST_ELEMENT_ERROR (faac, LIBRARY, ENCODE, (NULL), (NULL)); - gst_buffer_unmap (in_buf, data, size); + if (in_buf) + gst_buffer_unmap (in_buf, data, -1); gst_buffer_unmap (out_buf, out_data, 0); gst_buffer_unref (out_buf); return GST_FLOW_ERROR;