mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
adapter: ensure automagic _unmap in some more cases
This commit is contained in:
parent
12757e604a
commit
ea2f87d34e
1 changed files with 8 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue