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 643301 - Adding a buffer to a buffer list iterates the list
Adding a buffer to a buffer list iterates the list
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-25 15:30 UTC by Jonas Holmberg
Modified: 2011-03-11 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use a GQueue instead of a GList (7.45 KB, patch)
2011-02-25 15:31 UTC, Jonas Holmberg
none Details | Review
Use a GQueue instead of a GList (7.26 KB, patch)
2011-02-25 15:37 UTC, Jonas Holmberg
committed Details | Review

Description Jonas Holmberg 2011-02-25 15:30:08 UTC
Adding a buffer to the end of a GstBufferList is supposed to be a fast operation, but it is not since the iterator does not advance its nextpointer when adding buffers and GList does not have a tail pointer.
Comment 1 Jonas Holmberg 2011-02-25 15:31:59 UTC
Created attachment 181922 [details] [review]
Use a GQueue instead of a GList

Using a GQueue to store the buffers makes it easier to add buffers to the end of the list and this operation will now be much more efficient.

Adding an entire GList of buffers using gst_buffer_list_iterator_add_list() will however have to iterate over the list being added to be able to update the tail pointer in the GQueue.
Comment 2 Jonas Holmberg 2011-02-25 15:37:54 UTC
Created attachment 181923 [details] [review]
Use a GQueue instead of a GList

Using a GQueue to store the buffers makes it easier to add buffers to the end of the list and this operation will now be much more efficient.

Adding an entire GList of buffers using gst_buffer_list_iterator_add_list() will however have to iterate over the list being added to be able to update the tail pointer in the GQueue.
Comment 3 Wim Taymans 2011-03-11 13:32:57 UTC
commit c4c06a2b883388d39c9a9ed5d6cb09110812226e
Author: Jonas Holmberg <jonas.holmberg@axis.com>
Date:   Fri Feb 25 16:20:49 2011 +0100

    bufferlist: Use a GQueue instead of a GList
    
    Adding a buffer to the end of a GstBufferList is supposed to be a fast
    operation, but it was not since the iterator does not advance its
    nextpointer when adding buffers and GList does not have a tail pointer.
    Using a GQueue to store the buffers makes it easier to add buffers to
    the end of the list and this operation will now be much more efficient.
    
    Adding an entire GList of buffers using
    gst_buffer_list_iterator_add_list() will however have to iterate over
    the list being added to be able to update the tail pointer in the
    GQueue.