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 580716 - race condition in gst_element_lost_state
race condition in gst_element_lost_state
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-29 09:39 UTC by Andy Wingo
Modified: 2009-05-26 11:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the problem (1001 bytes, patch)
2009-04-29 09:40 UTC, Andy Wingo
committed Details | Review

Description Andy Wingo 2009-04-29 09:39:46 UTC
gst_element_lost_state has a race condition. Here's my understanding of how it can happen, but Wim understands it better.

  1. Have a pipeline in PLAYING
  2. Set it to PAUSED
  3. Send a flushing seek

After (2) the pipeline is asynchronously changing to paused. If the transition completes successfully before the seek happens, there's no race; but if we seek while the element has a GST_STATE_PENDING, the sink's call to gst_element_lost_state will fail to post an async-start message.

The async-start message is needed to tell the pipeline to reset the base time when the element goes PLAYING again. Loss of this message means that the pipeline won't get a base_time reset.

We haven't seen this problem very much until now because most of our pipelines run with the audio clock, which does not run in PAUSED, hence no need to distribute a new base time. But if the clock does run in PAUSED, this problem is fairly easy to hit.

The solution is to post async-start (though not state-changed) in gst_element_lost_state if lost_state is called during an async state change.
Comment 1 Andy Wingo 2009-04-29 09:40:49 UTC
Created attachment 133547 [details] [review]
patch to fix the problem
Comment 2 Andy Wingo 2009-04-29 09:41:13 UTC
That patch came from Wim, though I cannot assert anything about where he got it from.
Comment 3 Andy Wingo 2009-04-29 09:51:08 UTC
Quote the Taymans:

"Slight clarification: ASYNC_START was posted in the PLAYING->PAUSED state change but that it should be posted again with the new_base_time set to TRUE"

It the posting with new_base_time=TRUE that we're missing, with this race.
Comment 4 Andy Wingo 2009-05-26 11:35:01 UTC
Fixed in 8c26c22f2c5f976695e1f5874aaba68286b46d38