mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-16 19:25:18 +00:00
Make sure a cothreaded element is selected as the first one to start the cothread_switch
Original commit message from CVS: Make sure a cothreaded element is selected as the first one to start the cothread_switch
This commit is contained in:
parent
18964cbfac
commit
0487371214
1 changed files with 17 additions and 1 deletions
18
gst/gstbin.c
18
gst/gstbin.c
|
@ -800,11 +800,27 @@ gst_bin_iterate_func (GstBin *bin)
|
|||
if (!chain->need_scheduling) continue;
|
||||
|
||||
if (chain->need_cothreads) {
|
||||
GList *entries;
|
||||
|
||||
// all we really have to do is switch to the first child
|
||||
// FIXME this should be lots more intelligent about where to start
|
||||
GST_DEBUG (0,"starting iteration via cothreads\n");
|
||||
|
||||
entry = GST_ELEMENT (chain->elements->data);
|
||||
entries = chain->elements;
|
||||
entry = NULL;
|
||||
|
||||
// find an element with a threadstate to start with
|
||||
while (entries) {
|
||||
entry = GST_ELEMENT (entries->data);
|
||||
|
||||
if (entry->threadstate)
|
||||
break;
|
||||
entries = g_list_next (entries);
|
||||
}
|
||||
// if we couldn't find one, bail out
|
||||
if (entries == NULL)
|
||||
GST_ERROR(GST_ELEMENT(bin),"no cothreaded elements found!");
|
||||
|
||||
GST_FLAG_SET (entry, GST_ELEMENT_COTHREAD_STOPPING);
|
||||
GST_DEBUG (0,"set COTHREAD_STOPPING flag on \"%s\"(@%p)\n",
|
||||
GST_ELEMENT_NAME (entry),entry);
|
||||
|
|
Loading…
Reference in a new issue