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 705332 - queue2: global state is affected by buffery query handling
queue2: global state is affected by buffery query handling
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal critical
: 1.1.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-02 08:57 UTC by Sjoerd Simons
Modified: 2013-08-16 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sjoerd Simons 2013-08-02 08:57:46 UTC
One thing i noticed when studying the queue2 code for a bit is that when a buffering query is handled it use the get_buffering_percent function to get some statitics. Unfortunately this function also calculated whether the queue should be buffering and adapts the global queue2 state in case of state transitions from/to buffering (including whether a buffering message was posted on the bus!).

This unfortunately means that there is a race which can cause buffering messages to never posted  iff the global state changes happen as a result of a query instead of resulting from bytes flowing in/out..

Unfortunately i didn't have the time to prepare a patch for this one :/
Comment 1 Tim-Philipp Müller 2013-08-16 15:55:36 UTC
I hope this fixes it:

 commit c02081ca30631824c116ef1057c1bd9054c70507
 Author: Tim-Philipp Müller <tim@centricular.net>
 Date:   Fri Aug 16 16:28:12 2013 +0100

    queue2: don't change global buffering state from within query handler
    
    When a buffering query is handled it uses the get_buffering_percent()
    function to get some statitics. Unfortunately this function also
    calculates whether the queue should be buffering and adapts the
    global queue2 state in case of state transitions from/to buffering
    (including whether a buffering message was posted on the bus!).
    
    This means that there is a race which can cause buffering messages
    to never posted if the global state changes happen as a result of aa
    query instead of resulting from bytes flowing in/out.
    
    Spotted by Sjoerd Simons.
    
    Change to only query state in get_buffering_percent() and update
    state only in update_buffering().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=705332


(Bit hard to test, since there's something messed up with queue2 download buffering in both totem and the playback test utility, but it's not related to this patch and also happens with 1.0 and 0.10.)