[0.11] gstreamer: output-selector: Do not false warn about unlinked pad

Tim Müller tpm at kemper.freedesktop.org
Sun Jan 1 18:35:19 PST 2012


Module: gstreamer
Branch: 0.11
Commit: 71fe1ad0709a18583d352f63951f4aec9ffffaf7
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=71fe1ad0709a18583d352f63951f4aec9ffffaf7

Author: Thiago Santos <thiago.sousa.santos at collabora.com>
Date:   Thu Dec 29 16:56:46 2011 -0300

output-selector: Do not false warn about unlinked pad

When output-selector didn't receive a newsegment event it would
warn about pad being unlinked when switching pads. Making the logs
wrong and misleading.

---

 plugins/elements/gstoutputselector.c |   39 ++++++++++++++++++---------------
 1 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c
index 41b176c..b3b6c36 100644
--- a/plugins/elements/gstoutputselector.c
+++ b/plugins/elements/gstoutputselector.c
@@ -453,7 +453,8 @@ gst_output_selector_switch (GstOutputSelector * osel)
 
   /* Switch */
   GST_OBJECT_LOCK (GST_OBJECT (osel));
-  GST_INFO ("switching to pad %" GST_PTR_FORMAT, osel->pending_srcpad);
+  GST_INFO_OBJECT (osel, "switching to pad %" GST_PTR_FORMAT,
+      osel->pending_srcpad);
   if (gst_pad_is_linked (osel->pending_srcpad)) {
     osel->active_srcpad = osel->pending_srcpad;
     res = TRUE;
@@ -464,23 +465,25 @@ gst_output_selector_switch (GstOutputSelector * osel)
 
   /* Send NEWSEGMENT event and latest buffer if switching succeeded
    * and we already have a valid segment configured */
-  if (res && osel->segment.format != GST_FORMAT_UNDEFINED) {
-    /* Send NEWSEGMENT to the pad we are going to switch to */
-    seg = &osel->segment;
-
-    /* If resending then mark newsegment start and position accordingly */
-    if (osel->resend_latest && osel->latest_buffer &&
-        GST_BUFFER_TIMESTAMP_IS_VALID (osel->latest_buffer)) {
-      start = position = GST_BUFFER_TIMESTAMP (osel->latest_buffer);
-    } else {
-      start = position = seg->last_stop;
-    }
-    ev = gst_event_new_new_segment (TRUE, seg->rate,
-        seg->format, start, seg->stop, position);
-    if (!gst_pad_push_event (osel->active_srcpad, ev)) {
-      GST_WARNING_OBJECT (osel,
-          "newsegment handling failed in %" GST_PTR_FORMAT,
-          osel->active_srcpad);
+  if (res) {
+    if (osel->segment.format != GST_FORMAT_UNDEFINED) {
+      /* Send NEWSEGMENT to the pad we are going to switch to */
+      seg = &osel->segment;
+
+      /* If resending then mark newsegment start and position accordingly */
+      if (osel->resend_latest && osel->latest_buffer &&
+          GST_BUFFER_TIMESTAMP_IS_VALID (osel->latest_buffer)) {
+        start = position = GST_BUFFER_TIMESTAMP (osel->latest_buffer);
+      } else {
+        start = position = seg->last_stop;
+      }
+      ev = gst_event_new_new_segment (TRUE, seg->rate,
+          seg->format, start, seg->stop, position);
+      if (!gst_pad_push_event (osel->active_srcpad, ev)) {
+        GST_WARNING_OBJECT (osel,
+            "newsegment handling failed in %" GST_PTR_FORMAT,
+            osel->active_srcpad);
+      }
     }
 
     /* Resend latest buffer to newly switched pad */



More information about the gstreamer-commits mailing list