[0.11] gstreamer: pad: make some errors critical

Wim Taymans wtay at kemper.freedesktop.org
Fri Feb 17 15:05:01 PST 2012


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

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Sat Feb 18 00:03:41 2012 +0100

pad: make some errors critical

When we have no chain function or when we are operating the pad in the wrong
mode, emit a critical instead of posting an error message. This is certainly a
programming error and we cannot always post a message (like when the pad has no
parent)

---

 gst/gstpad.c |   30 ++++++++++++------------------
 1 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/gst/gstpad.c b/gst/gstpad.c
index 74ebfd4..f7802d5 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -3369,9 +3369,8 @@ flushing:
   }
 wrong_mode:
   {
-    GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
-        ("chain on pad %s:%s but it was not in push mode",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("chain on pad %s:%s but it was not in push mode",
+        GST_DEBUG_PAD_NAME (pad));
     GST_OBJECT_UNLOCK (pad);
     GST_PAD_STREAM_UNLOCK (pad);
     gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
@@ -3397,9 +3396,8 @@ probe_stopped:
 no_function:
   {
     gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
-    GST_ELEMENT_ERROR (parent, CORE, PAD, (NULL),
-        ("chain on pad %s:%s but it has no chainfunction",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("chain on pad %s:%s but it has no chainfunction",
+        GST_DEBUG_PAD_NAME (pad));
     GST_PAD_STREAM_UNLOCK (pad);
     return GST_FLOW_NOT_SUPPORTED;
   }
@@ -3572,9 +3570,8 @@ flushing:
   }
 wrong_mode:
   {
-    GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
-        ("pushing on pad %s:%s but it was not activated in push mode",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("pushing on pad %s:%s but it was not activated in push mode",
+        GST_DEBUG_PAD_NAME (pad));
     GST_OBJECT_UNLOCK (pad);
     gst_mini_object_unref (GST_MINI_OBJECT_CAST (data));
     return GST_FLOW_ERROR;
@@ -3756,9 +3753,8 @@ flushing:
   }
 wrong_mode:
   {
-    GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
-        ("getrange on pad %s:%s but it was not activated in pull mode",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("getrange on pad %s:%s but it was not activated in pull mode",
+        GST_DEBUG_PAD_NAME (pad));
     GST_OBJECT_UNLOCK (pad);
     GST_PAD_STREAM_UNLOCK (pad);
     return GST_FLOW_ERROR;
@@ -3779,9 +3775,8 @@ no_parent:
   }
 no_function:
   {
-    GST_ELEMENT_ERROR (parent, CORE, PAD, (NULL),
-        ("getrange on pad %s:%s but it has no getrangefunction",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("getrange on pad %s:%s but it has no getrangefunction",
+        GST_DEBUG_PAD_NAME (pad));
     RELEASE_PARENT (parent);
     GST_PAD_STREAM_UNLOCK (pad);
     return GST_FLOW_NOT_SUPPORTED;
@@ -3937,9 +3932,8 @@ flushing:
   }
 wrong_mode:
   {
-    GST_ELEMENT_ERROR (GST_PAD_PARENT (pad), CORE, PAD, (NULL),
-        ("gpulltange on pad %s:%s but it was not activated in pull mode",
-            GST_DEBUG_PAD_NAME (pad)));
+    g_critical ("pullrange on pad %s:%s but it was not activated in pull mode",
+        GST_DEBUG_PAD_NAME (pad));
     GST_OBJECT_UNLOCK (pad);
     return GST_FLOW_ERROR;
   }



More information about the gstreamer-commits mailing list