gst/schedulers/gstoptimalscheduler.c: When we're recursing into a chain run, only run the directly related group, not...

Original commit message from CVS:
* gst/schedulers/gstoptimalscheduler.c:
(gst_opt_scheduler_schedule_run_queue), (schedule_chain),
(gst_opt_scheduler_get_wrapper):
When we're recursing into a chain run, only run the directly
related group, not all queued ones. This will fix a possible
deadlock in chains with more than two groups.
This commit is contained in:
Ronald S. Bultje 2004-12-09 11:48:28 +00:00
parent 047c0a3e9b
commit 474d0415aa
2 changed files with 22 additions and 8 deletions

View file

@ -1,3 +1,12 @@
2004-12-09 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/schedulers/gstoptimalscheduler.c:
(gst_opt_scheduler_schedule_run_queue), (schedule_chain),
(gst_opt_scheduler_get_wrapper):
When we're recursing into a chain run, only run the directly
related group, not all queued ones. This will fix a possible
deadlock in chains with more than two groups.
2004-12-08 Thomas Vander Stichele <thomas at apestaart dot org>
* autogen.sh:

View file

@ -2,7 +2,7 @@
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* gstscheduler.c: Default scheduling code for most cases
* gstoptimalscheduler.c: Default scheduling code for most cases
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -280,7 +280,8 @@ static GstData *gst_opt_scheduler_get_wrapper (GstPad * srcpad);
* instead of relying on cothreads to do the switch for us.
*/
#ifndef USE_COTHREADS
static void gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched);
static void gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched,
GstOptSchedulerGroup * only_group);
#endif
@ -1167,7 +1168,8 @@ schedule_group (GstOptSchedulerGroup * group)
#ifndef USE_COTHREADS
static void
gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched)
gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched,
GstOptSchedulerGroup * only_group)
{
GST_LOG_OBJECT (osched, "running queue: %d groups, recursed %d times",
g_list_length (osched->runqueue),
@ -1183,10 +1185,13 @@ gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched)
osched->recursion++;
while (osched->runqueue) {
do {
GstOptSchedulerGroup *group;
gboolean res;
if (only_group)
group = only_group;
else
group = (GstOptSchedulerGroup *) osched->runqueue->data;
/* runqueue holds refcount to group */
@ -1208,7 +1213,7 @@ gst_opt_scheduler_schedule_run_queue (GstOptScheduler * osched)
GST_LOG_OBJECT (osched, "done scheduling group %p", group);
}
unref_group (group);
}
} while (osched->runqueue && !only_group);
GST_LOG_OBJECT (osched, "run queue length after scheduling %d",
g_list_length (osched->runqueue));
@ -1248,7 +1253,7 @@ schedule_chain (GstOptSchedulerChain * chain)
ref_group (group);
osched->runqueue = g_list_append (osched->runqueue, group);
}
gst_opt_scheduler_schedule_run_queue (osched);
gst_opt_scheduler_schedule_run_queue (osched, NULL);
#endif
GST_LOG ("done scheduling group %p in chain %p", group, chain);
@ -1441,7 +1446,7 @@ gst_opt_scheduler_get_wrapper (GstPad * srcpad)
}
GST_LOG ("recursing into scheduler group %p", group);
gst_opt_scheduler_schedule_run_queue (osched);
gst_opt_scheduler_schedule_run_queue (osched, group);
GST_LOG ("return from recurse group %p", group);
/* if the other group was disabled we might have to break out of the loop */