diff --git a/gst/gstbin.c b/gst/gstbin.c index fc70c1d366..de2f68dfd3 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -551,12 +551,6 @@ gst_bin_create_plan_func (GstBin *bin) const gchar *elementname; GSList *pending = NULL; GstBin *pending_bin; -// GList *pads; -// GstPad *pad; -// GstElement *peer_manager; -// cothread_func wrapper_function; -// _GstBinChain *chain; -// GList *chains; DEBUG_SET_STRING("(\"%s\")",gst_element_get_name (GST_ELEMENT (bin))); DEBUG_ENTER_STRING; @@ -639,9 +633,6 @@ gst_bin_create_plan_func (GstBin *bin) g_list_free (bin->managed_elements); bin->managed_elements = NULL; bin->num_managed_elements = 0; - g_list_free (bin->entries); - bin->entries = NULL; - bin->num_entries = 0; // find all the managed children // here we pull off the trick of walking an entire arbitrary tree without recursion diff --git a/gst/gstbin.h b/gst/gstbin.h index b62effa9a8..256459b8a1 100644 --- a/gst/gstbin.h +++ b/gst/gstbin.h @@ -102,8 +102,6 @@ struct __GstBinChain { GList *entries; gboolean need_cothreads; - - GstElement *entry; }; diff --git a/gst/gstscheduler.c b/gst/gstscheduler.c index dd55a24d39..e8359050bb 100644 --- a/gst/gstscheduler.c +++ b/gst/gstscheduler.c @@ -292,6 +292,24 @@ gst_schedule_chained_chain (GstBin *bin, _GstBinChain *chain) { } } +static void gst_bin_schedule_cleanup(GstBin *bin) { + GList *chains; + _GstBinChain *chain; + + chains = bin->chains; + while (chains) { + chain = (_GstBinChain *)(chains->data); + chains = g_list_next(chains); + + g_list_free(chain->elements); + g_list_free(chain->entries); + + g_free(chain); + } + + g_list_free(bin->chains); +} + void gst_bin_schedule_func(GstBin *bin) { // GstElement *manager; GList *elements; @@ -308,6 +326,8 @@ void gst_bin_schedule_func(GstBin *bin) { DEBUG_SET_STRING("(\"%s\")",gst_element_get_name (GST_ELEMENT (bin))); DEBUG_ENTER_STRING; + gst_bin_schedule_cleanup(bin); + // next we have to find all the separate scheduling chains DEBUG("\nattempting to find scheduling chains...\n"); // first make a copy of the managed_elements we can mess with