[0.11] gst-plugins-bad: faac: fix some input and output buffer map and ref handling

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Wed Jan 11 04:01:12 PST 2012


Module: gst-plugins-bad
Branch: 0.11
Commit: 9f136a667d459d22e925ffb27e851b7ea6e89228
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=9f136a667d459d22e925ffb27e851b7ea6e89228

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Wed Jan 11 12:58:08 2012 +0100

faac: fix some input and output buffer map and ref handling

---

 ext/faac/gstfaac.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ext/faac/gstfaac.c b/ext/faac/gstfaac.c
index ecae7da..a44d886 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;



More information about the gstreamer-commits mailing list