mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
Remove skipped part of buffer when mapping the adapter
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674085
This commit is contained in:
parent
fc8b28455f
commit
4e7cf4c5c1
1 changed files with 5 additions and 3 deletions
|
@ -361,11 +361,13 @@ gst_adapter_try_to_merge_up (GstAdapter * adapter, gsize size)
|
|||
head = g->data;
|
||||
g = g_slist_next (g);
|
||||
|
||||
/* How large do we want our head buffer? The requested size, plus whatever's
|
||||
* been skipped already */
|
||||
size += adapter->skip;
|
||||
hsize = gst_buffer_get_size (head);
|
||||
|
||||
/* Remove skipped part from the buffer (otherwise the buffer might grow indefinitely) */
|
||||
gst_buffer_resize (head, adapter->skip, hsize - adapter->skip);
|
||||
hsize -= adapter->skip;
|
||||
adapter->skip = 0;
|
||||
|
||||
while (g != NULL && hsize < size) {
|
||||
cur = g->data;
|
||||
/* Merge the head buffer and the next in line */
|
||||
|
|
Loading…
Reference in a new issue