GNOME Bugzilla – Bug 705332
queue2: global state is affected by buffery query handling
Last modified: 2013-08-16 15:55:36 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 :/
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.)