summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-07-21 00:17:28 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-07-21 00:22:25 -0300
commit0accb7f700a737646fe3460442cfcfec377ece14 (patch)
treea4a46c670043909f2724387d2252120aef09324d
parentc97f82e32be3f118bf42107fdc6df50b5b262db1 (diff)
concat: dot not reset pad states too early
Resetting the flushing state of the pads at the end of the PAUSED_TO_READY transition will make pads handle serialized queries again which will wait for non-active pads and might cause deadlocks when stopping the pipeline. Move the reset to the READY_TO_PAUSED instead. https://bugzilla.gnome.org/show_bug.cgi?id=752623
-rw-r--r--plugins/elements/gstconcat.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/plugins/elements/gstconcat.c b/plugins/elements/gstconcat.c
index 41e93f789..5397c8e48 100644
--- a/plugins/elements/gstconcat.c
+++ b/plugins/elements/gstconcat.c
@@ -797,47 +797,35 @@ gst_concat_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:{
+ GstIterator *iter = gst_element_iterate_sink_pads (element);
+ GstIteratorResult res;
+
self->format = GST_FORMAT_UNDEFINED;
self->current_start_offset = 0;
self->last_stop = GST_CLOCK_TIME_NONE;
- break;
- }
- case GST_STATE_CHANGE_PAUSED_TO_READY:{
- GstIterator *iter = gst_element_iterate_sink_pads (element);
- GstIteratorResult res;
- g_mutex_lock (&self->lock);
do {
- res = gst_iterator_foreach (iter, unblock_pad, NULL);
+ res = gst_iterator_foreach (iter, reset_pad, NULL);
} while (res == GST_ITERATOR_RESYNC);
gst_iterator_free (iter);
- g_cond_broadcast (&self->cond);
- g_mutex_unlock (&self->lock);
if (res == GST_ITERATOR_ERROR)
return GST_STATE_CHANGE_FAILURE;
-
break;
}
- default:
- break;
- }
-
- ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
- if (ret == GST_STATE_CHANGE_FAILURE)
- return ret;
-
- switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:{
GstIterator *iter = gst_element_iterate_sink_pads (element);
GstIteratorResult res;
+ g_mutex_lock (&self->lock);
do {
- res = gst_iterator_foreach (iter, reset_pad, NULL);
+ res = gst_iterator_foreach (iter, unblock_pad, NULL);
} while (res == GST_ITERATOR_RESYNC);
gst_iterator_free (iter);
+ g_cond_broadcast (&self->cond);
+ g_mutex_unlock (&self->lock);
if (res == GST_ITERATOR_ERROR)
return GST_STATE_CHANGE_FAILURE;
@@ -848,5 +836,7 @@ gst_concat_change_state (GstElement * element, GstStateChange transition)
break;
}
+ ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
return ret;
}