GNOME Bugzilla – Bug 674085
[0.11] GstAdapter's buffer keeps growing indefinitely
Last modified: 2012-04-14 08:29:15 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 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.
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