diff --git a/ChangeLog b/ChangeLog index a870672640..c92ab0e50c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-04-20 Benjamin Otte + + * gst/autoplug/gstspider.c: (gst_spider_link_sometimes), + (gst_spider_identity_plug): + improve debugging messages + * gst/gstbin.c: (gst_bin_remove_func): + make sure the state_change function is only called with simple state + transitions + 2004-04-20 Thomas Vander Stichele * Makefile.am: diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index 9f2dda1b12..cc7731917e 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -307,6 +307,7 @@ gst_spider_link_sometimes (GstElement * src, GstPad * pad, { gulong signal_id = conn->signal_id; + GST_INFO ("plugging from new sometimes pad %s:%s", GST_DEBUG_PAD_NAME (pad)); /* try to autoplug the elements */ if (gst_spider_plug_from_srcpad (conn, pad) != GST_PAD_LINK_REFUSED) { GST_DEBUG ("%s:%s was autoplugged to %s:%s, removing callback", @@ -430,7 +431,8 @@ gst_spider_identity_plug (GstSpiderIdentity * ident) while (factories) { if ((padtemp = gst_autoplug_can_connect_src (factories->data, src_caps))) { - GST_DEBUG ("can connect src to pad template: %" GST_PTR_FORMAT, + GST_DEBUG ("can connect src to %s pad template: %" GST_PTR_FORMAT, + GST_PLUGIN_FEATURE_NAME (factories->data), gst_pad_template_get_caps (padtemp)); found = TRUE; } diff --git a/gst/gstbin.c b/gst/gstbin.c index 6a996b9f8f..7298943609 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -548,9 +548,17 @@ gst_bin_remove_func (GstBin * bin, GstElement * element) gst_object_unparent (GST_OBJECT (element)); /* if we're down to zero children, force state to NULL */ - if (bin->numchildren == 0 && GST_ELEMENT_SCHED (bin) != NULL) { - GST_STATE_PENDING (bin) = GST_STATE_NULL; + while (bin->numchildren == 0 && GST_ELEMENT_SCHED (bin) != NULL && + GST_STATE (bin) > GST_STATE_NULL) { + GstElementState next = GST_STATE (bin) >> 1; + + GST_STATE_PENDING (bin) = next; gst_bin_change_state_norecurse (bin); + if (!GST_STATE (bin) == next) { + g_warning ("bin %s failed state change to %d", GST_ELEMENT_NAME (bin), + next); + break; + } } g_signal_emit (G_OBJECT (bin), gst_bin_signals[ELEMENT_REMOVED], 0, element);