From 37717df4826b4168eb4071a78951ed57d6456c09 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 10 Jul 2003 20:40:02 +0000 Subject: [PATCH] Added some comments and use _PAD_IS_USABLE instead of _IS_ACTIVE Original commit message from CVS: Added some comments and use _PAD_IS_USABLE instead of _IS_ACTIVE --- gst/elements/gstaggregator.c | 11 +++++++++-- plugins/elements/gstaggregator.c | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gst/elements/gstaggregator.c b/gst/elements/gstaggregator.c index 2506d26391..1f13b87602 100644 --- a/gst/elements/gstaggregator.c +++ b/gst/elements/gstaggregator.c @@ -301,15 +301,22 @@ gst_aggregator_loop (GstElement *element) if (aggregator->sched == AGGREGATOR_LOOP) { GList *pads = aggregator->sinkpads; + /* we'll loop over all pads and try to pull from all + * active ones */ while (pads) { GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); - g_print ("inspecting pad %s:%s\n", GST_DEBUG_PAD_NAME (pad)); - if (GST_PAD_IS_ACTIVE (pad)) { + /* we need to check is the pad is usable. IS_USABLE will check + * if the pad is linked, if it is enabled (the element is + * playing and the app didn't gst_pad_set_enabled (pad, FALSE)) + * and that the peer pad is also enabled. + */ + if (GST_PAD_IS_USABLE (pad)) { buf = gst_pad_pull (pad); debug = "loop"; + /* then push it forward */ gst_aggregator_push (aggregator, pad, buf, debug); } } diff --git a/plugins/elements/gstaggregator.c b/plugins/elements/gstaggregator.c index 2506d26391..1f13b87602 100644 --- a/plugins/elements/gstaggregator.c +++ b/plugins/elements/gstaggregator.c @@ -301,15 +301,22 @@ gst_aggregator_loop (GstElement *element) if (aggregator->sched == AGGREGATOR_LOOP) { GList *pads = aggregator->sinkpads; + /* we'll loop over all pads and try to pull from all + * active ones */ while (pads) { GstPad *pad = GST_PAD (pads->data); pads = g_list_next (pads); - g_print ("inspecting pad %s:%s\n", GST_DEBUG_PAD_NAME (pad)); - if (GST_PAD_IS_ACTIVE (pad)) { + /* we need to check is the pad is usable. IS_USABLE will check + * if the pad is linked, if it is enabled (the element is + * playing and the app didn't gst_pad_set_enabled (pad, FALSE)) + * and that the peer pad is also enabled. + */ + if (GST_PAD_IS_USABLE (pad)) { buf = gst_pad_pull (pad); debug = "loop"; + /* then push it forward */ gst_aggregator_push (aggregator, pad, buf, debug); } }