[0.11] gstreamer: adapter: ensure automagic _unmap in some more cases

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Sat Jan 14 11:53:16 PST 2012


Module: gstreamer
Branch: 0.11
Commit: ea2f87d34e72a268d5607661ebc80703b2fc8d50
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=ea2f87d34e72a268d5607661ebc80703b2fc8d50

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Wed Jan 11 10:59:53 2012 +0100

adapter: ensure automagic _unmap in some more cases

---

 libs/gst/base/gstadapter.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/libs/gst/base/gstadapter.c b/libs/gst/base/gstadapter.c
index 2f14541..b932f3a 100644
--- a/libs/gst/base/gstadapter.c
+++ b/libs/gst/base/gstadapter.c
@@ -422,6 +422,10 @@ gst_adapter_map (GstAdapter * adapter, gsize size)
   g_return_val_if_fail (GST_IS_ADAPTER (adapter), NULL);
   g_return_val_if_fail (size > 0, NULL);
 
+  if (adapter->priv->cdata) {
+    gst_adapter_unmap (adapter);
+  }
+
   /* we don't have enough data, return NULL. This is unlikely
    * as one usually does an _available() first instead of peeking a
    * random size. */
@@ -544,6 +548,10 @@ gst_adapter_flush_unchecked (GstAdapter * adapter, gsize flush)
 
   GST_LOG_OBJECT (adapter, "flushing %" G_GSIZE_FORMAT " bytes", flush);
 
+  if (adapter->priv->cdata) {
+    gst_adapter_unmap (adapter);
+  }
+
   priv = adapter->priv;
 
   /* clear state */



More information about the gstreamer-commits mailing list