GNOME Bugzilla – Bug 553874
query_position broken during seek
Last modified: 2008-10-06 08:58:32 UTC
Please describe the problem: When I query the position of a playbin while a seek occurs, there is a race condition that the actual position returned is 0, even if the seek is from one non-null position to another, for example from 3 seconds to 5 seconds. This occurs irregardless if the pipeline is paused or playing during the whole operation. The race window seems to be located after a state change from PAUSED to PAUSED with pending PAUSED. The attached example program illustrates the problem. The race is reliably hit in 0.10.18, but also occurs in 0.10.20, although the window seems smaller. Other possibilities beside a race condition: It may be that the query_position call is supposed to fail. In this case, it should return FALSE instead of TRUE. That the function returns TRUE and position 0 may be a different bug. Furthermore, if the function is supposed to fail while there are pending state changes, this should be clearly documented. I could not find any restriction on query_position in the documentation of it or that of the pending state. Steps to reproduce: 1. Run the attached example program on an ogg file that is at least 10 seconds long. Also try it with the initial state being PLAYING instead of PAUSING. The output and expected output is detailed in a comment in the source. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 119395 [details] test program that shows query_position problem during seek Compile with; $ cc -g -Wall `pkg-config --cflags libglade-2.0 libgnomeui-2.0 gstreamer-0.10` `pkg-config --libs libglade-2.0 libgnomeui-2.0 gstreamer-0.10` -rdynamic helloworld.c -o helloworld Run with ogg file longer than 10 seconds.
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_position), (gst_base_sink_query): Improve position reporting while flushing and other intermediate state changes. Fixes #553874.