After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674085 - [0.11] GstAdapter's buffer keeps growing indefinitely
[0.11] GstAdapter's buffer keeps growing indefinitely
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.11.x
Other Mac OS
: Normal major
: 0.11.x
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-04-14 01:35 UTC by Matej Knopp
Modified: 2012-04-14 08:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to remove skipped part of adapter's buffer during mapping (1.11 KB, patch)
2012-04-14 01:35 UTC, Matej Knopp
none Details | Review

Description Matej Knopp 2012-04-14 01:35:17 UTC
Created attachment 212029 [details] [review]
Patch to remove skipped part of adapter's buffer during mapping

Take the following scenario

adapter.push(10 bytes)
for (int i = 0; i < 1000; ++i)
{
  adapter.push(10 bytes);
  adapter.map
  adapter.unmap
  adapter.flush(10 bytes)
}

Here the adapter's head buffer will be 1000 * 10 bytes large, i.e. it will grow 10 bytes during every iteration. 

In my test after few seconds of video playback the buffer of video parser adapter grew to several megabytes and the reallocations took more CPU cycles than actual video decoding.
Comment 1 Matej Knopp 2012-04-14 01:35:49 UTC
Comment on attachment 212029 [details] [review]
Patch to remove skipped part of adapter's buffer during mapping

Removing the skipped part of head buffer prevents it from growing indefinitely.
Comment 2 Wim Taymans 2012-04-14 08:29:15 UTC
commit 4e7cf4c5c1c70f5cfc17f50e4d69ef0058b2e597
Author: Matej Knopp <matej.knopp@gmail.com>
Date:   Sat Apr 14 03:27:29 2012 +0200

    Remove skipped part of buffer when mapping the adapter
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674085