gst/gstbin.c: Explicitely make an element release locks in a group when being remove from a bin.

Original commit message from CVS:
* gst/gstbin.c: (gst_bin_remove_func):
Explicitely make an element release locks in a group when being
remove from a bin.
* gst/gstqueue.c: (gst_queue_chain), (gst_queue_get):
If there's no scheduler, always return immediately (similar to
gst_element_interrupt).
This commit is contained in:
Ronald S. Bultje 2005-01-31 23:21:52 +00:00
parent 77bf6d8c0f
commit 6a4b9177e4
4 changed files with 28 additions and 8 deletions

View file

@ -1,3 +1,12 @@
2005-02-01 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstbin.c: (gst_bin_remove_func):
Explicitely make an element release locks in a group when being
remove from a bin.
* gst/gstqueue.c: (gst_queue_chain), (gst_queue_get):
If there's no scheduler, always return immediately (similar to
gst_element_interrupt).
2005-01-31 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstbin.c: (gst_bin_child_state_change_func):

View file

@ -555,6 +555,9 @@ gst_bin_remove_func (GstBin * bin, GstElement * element)
/* remove this element from the list of managed elements */
gst_bin_unset_element_sched (element, GST_ELEMENT_SCHED (bin));
/* if it is still iterating, make it stop */
gst_element_release_locks (element);
/* now remove the element from the list of elements */
bin->children = g_list_remove (bin->children, element);
bin->numchildren--;

View file

@ -654,10 +654,12 @@ restart:
* or its manager, switch back to iterator so bottom
* half of state change executes */
if (queue->interrupt) {
GstScheduler *sched;
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
GST_QUEUE_MUTEX_UNLOCK;
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->sinkpad),
GST_ELEMENT (queue))) {
sched = gst_pad_get_scheduler (queue->sinkpad);
if (!sched || gst_scheduler_interrupt (sched, GST_ELEMENT (queue))) {
goto out_unref;
}
/* if we got here because we were unlocked after a
@ -778,10 +780,12 @@ restart:
* manager, switch back to iterator so bottom half of state
* change executes. */
if (queue->interrupt) {
GstScheduler *sched;
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
GST_QUEUE_MUTEX_UNLOCK;
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->srcpad),
GST_ELEMENT (queue)))
sched = gst_pad_get_scheduler (queue->srcpad);
if (!sched || gst_scheduler_interrupt (sched, GST_ELEMENT (queue)))
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
goto restart;
}

View file

@ -654,10 +654,12 @@ restart:
* or its manager, switch back to iterator so bottom
* half of state change executes */
if (queue->interrupt) {
GstScheduler *sched;
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
GST_QUEUE_MUTEX_UNLOCK;
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->sinkpad),
GST_ELEMENT (queue))) {
sched = gst_pad_get_scheduler (queue->sinkpad);
if (!sched || gst_scheduler_interrupt (sched, GST_ELEMENT (queue))) {
goto out_unref;
}
/* if we got here because we were unlocked after a
@ -778,10 +780,12 @@ restart:
* manager, switch back to iterator so bottom half of state
* change executes. */
if (queue->interrupt) {
GstScheduler *sched;
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "interrupted");
GST_QUEUE_MUTEX_UNLOCK;
if (gst_scheduler_interrupt (gst_pad_get_scheduler (queue->srcpad),
GST_ELEMENT (queue)))
sched = gst_pad_get_scheduler (queue->srcpad);
if (!sched || gst_scheduler_interrupt (sched, GST_ELEMENT (queue)))
return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT));
goto restart;
}