mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
Poll instead of blocking when waiting for a state change
Original commit message from CVS: Poll instead of blocking when waiting for a state change
This commit is contained in:
parent
ec59b53862
commit
d88e845615
1 changed files with 7 additions and 3 deletions
10
gst/gstbin.c
10
gst/gstbin.c
|
@ -135,6 +135,9 @@ gst_bin_init (GstBin * bin)
|
|||
|
||||
bin->numchildren = 0;
|
||||
bin->children = NULL;
|
||||
|
||||
bin->iterate_mutex = g_mutex_new ();
|
||||
bin->iterate_cond = g_cond_new ();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -850,9 +853,10 @@ gst_bin_iterate (GstBin * bin)
|
|||
if (!running) {
|
||||
if (GST_STATE (bin) == GST_STATE_PLAYING && GST_STATE_PENDING (bin) == GST_STATE_VOID_PENDING) {
|
||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin,
|
||||
"waiting for child shutdown after useless iteration");
|
||||
gst_element_wait_state_change (GST_ELEMENT (bin));
|
||||
GST_DEBUG_ELEMENT (GST_CAT_DATAFLOW, bin, "child shutdown");
|
||||
"polling for child shutdown after useless iteration");
|
||||
usleep (1);
|
||||
//gst_element_wait_state_change (GST_ELEMENT (bin));
|
||||
running = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue