mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
adapter: ensure writable head buffer before skipping part of it
This commit is contained in:
parent
304047b13d
commit
9bcb0ea58e
1 changed files with 4 additions and 1 deletions
|
@ -359,14 +359,17 @@ gst_adapter_try_to_merge_up (GstAdapter * adapter, gsize size)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
head = g->data;
|
head = g->data;
|
||||||
g = g_slist_next (g);
|
|
||||||
|
|
||||||
hsize = gst_buffer_get_size (head);
|
hsize = gst_buffer_get_size (head);
|
||||||
|
|
||||||
/* Remove skipped part from the buffer (otherwise the buffer might grow indefinitely) */
|
/* Remove skipped part from the buffer (otherwise the buffer might grow indefinitely) */
|
||||||
|
head = gst_buffer_make_writable (head);
|
||||||
gst_buffer_resize (head, adapter->skip, hsize - adapter->skip);
|
gst_buffer_resize (head, adapter->skip, hsize - adapter->skip);
|
||||||
hsize -= adapter->skip;
|
hsize -= adapter->skip;
|
||||||
adapter->skip = 0;
|
adapter->skip = 0;
|
||||||
|
g->data = head;
|
||||||
|
|
||||||
|
g = g_slist_next (g);
|
||||||
|
|
||||||
while (g != NULL && hsize < size) {
|
while (g != NULL && hsize < size) {
|
||||||
cur = g->data;
|
cur = g->data;
|
||||||
|
|
Loading…
Reference in a new issue