diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-01-11 10:59:53 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-01-13 14:21:27 +0100 |
commit | ea2f87d34e72a268d5607661ebc80703b2fc8d50 (patch) | |
tree | 0c5d96e9aeeea95b0dcf109f249375653147b2d5 | |
parent | 12757e604a894533b8fcd80a128eee528a613851 (diff) |
adapter: ensure automagic _unmap in some more cases
-rw-r--r-- | 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 2f14541852..b932f3a964 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 */ |