From 1f5a5c6bbe4cdda703cf6e7cdb2e9e52494406af Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 22 Jun 2006 17:09:13 +0000 Subject: [PATCH] gst/gstelement.c: We need to deactivate src pads first and then sink pads. Original commit message from CVS: * gst/gstelement.c: (gst_element_pads_activate): We need to deactivate src pads first and then sink pads. The reason is the src pads might be blocking while holding the streaming lock, so we need to deactivate them first so that deactivating the sink pads doesn't block (since it will require the streaming lock). --- ChangeLog | 8 ++++++++ gst/gstelement.c | 10 ++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32c53e590b..321eacd4a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-22 Edward Hervey + + * gst/gstelement.c: (gst_element_pads_activate): + We need to deactivate src pads first and then sink pads. + The reason is the src pads might be blocking while holding the streaming + lock, so we need to deactivate them first so that deactivating the sink + pads doesn't block (since it will require the streaming lock). + 2006-06-22 Wim Taymans * libs/gst/base/gstbasetransform.c: diff --git a/gst/gstelement.c b/gst/gstelement.c index fea77730d8..15a70fa607 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -2308,10 +2308,7 @@ gst_element_pads_activate (GstElement * element, gboolean active) g_value_init (&ret, G_TYPE_BOOLEAN); g_value_set_boolean (&ret, TRUE); - if (active) - iter = gst_element_iterate_src_pads (element); - else - iter = gst_element_iterate_sink_pads (element); + iter = gst_element_iterate_src_pads (element); fold_ok = iterator_fold_with_resync (iter, (GstIteratorFoldFunction) activate_pads, &ret, &active); gst_iterator_free (iter); @@ -2320,10 +2317,7 @@ gst_element_pads_activate (GstElement * element, gboolean active) return FALSE; } - if (active) - iter = gst_element_iterate_sink_pads (element); - else - iter = gst_element_iterate_src_pads (element); + iter = gst_element_iterate_sink_pads (element); fold_ok = iterator_fold_with_resync (iter, (GstIteratorFoldFunction) activate_pads, &ret, &active); gst_iterator_free (iter);