gst/elements/gsttypefindelement.c: Don't restart typefinding on a discont.
authorJan Schmidt <thaytan@mad.scientist.com>
Thu, 23 Jun 2005 11:43:39 +0000 (11:43 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Thu, 23 Jun 2005 11:43:39 +0000 (11:43 +0000)
Original commit message from CVS:
2005-06-23  Jan Schmidt  <thaytan@mad.scientist.com>

* gst/elements/gsttypefindelement.c:
(gst_type_find_element_handle_event):
Don't restart typefinding on a discont.
* gst/gstelement.c: (gst_element_set_state):
Debug spelling fix.
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_send_event):
Allow changing mode of an active pad.
Debug output fixes.
* gst/registries/gstlibxmlregistry.c: (load_feature):
Don't cast a static pad template to a normal pad template.

ChangeLog
gst/elements/gsttypefindelement.c
gst/gstelement.c
gst/gstpad.c
gst/registries/gstlibxmlregistry.c
plugins/elements/gsttypefindelement.c

index a79daab..472b567 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-06-23  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * gst/elements/gsttypefindelement.c:
+       (gst_type_find_element_handle_event):
+         Don't restart typefinding on a discont.
+       * gst/gstelement.c: (gst_element_set_state):
+         Debug spelling fix.
+       * gst/gstpad.c: (gst_pad_set_active), (gst_pad_send_event):
+         Allow changing mode of an active pad.
+         Debug output fixes.
+       * gst/registries/gstlibxmlregistry.c: (load_feature):
+         Don't cast a static pad template to a normal pad template.
+
 2005-06-23  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * check/gst/gstvalue.c: (START_TEST), (gst_value_suite):
index 1bb130d..1eb7195 100644 (file)
@@ -514,7 +514,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
       }
       break;
     case MODE_NORMAL:
-      if (GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
+      if (FALSE) {              // GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
         start_typefinding (typefind);
         gst_event_unref (event);
         res = TRUE;
index 6a24a80..cec15fb 100644 (file)
@@ -1781,7 +1781,8 @@ invalid_return:
   {
     GST_STATE_UNLOCK (element);
     /* somebody added a GST_STATE_ and forgot to do stuff here ! */
-    g_critical ("unkown return value from a state change function");
+    g_critical ("unknown return value %d from a state change function",
+        return_val);
     return GST_STATE_FAILURE;
   }
 }
index 40b74dd..a441c4d 100644 (file)
@@ -427,7 +427,7 @@ gst_pad_set_active (GstPad * pad, GstActivateMode mode)
   oldactive = GST_PAD_MODE_ACTIVATE (old);
 
   /* if nothing changed, we can just exit */
-  if (G_UNLIKELY (oldactive == active))
+  if (G_UNLIKELY (oldactive == active && old == mode))
     goto was_ok;
 
   /* FIXME, no mode switching yet, need more design docs first */
@@ -436,8 +436,10 @@ gst_pad_set_active (GstPad * pad, GstActivateMode mode)
     goto was_ok;
 #endif
 
-  /* make sure data is disallowed when going inactive */
-  if (!active) {
+  /* make sure data is disallowed when going inactive or changing
+   * mode
+   */
+  if (!active || oldactive) {
     GST_CAT_DEBUG (GST_CAT_PADS, "de-activating pad %s:%s",
         GST_DEBUG_PAD_NAME (pad));
     GST_PAD_SET_FLUSHING (pad);
@@ -2915,12 +2917,11 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
   if (GST_EVENT_SRC (event) == NULL)
     GST_EVENT_SRC (event) = gst_object_ref (GST_OBJECT (pad));
 
-  GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d on pad %s:%s",
-      GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
-
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_FLUSH:
-      GST_CAT_DEBUG (GST_CAT_EVENT, "have flush event");
+      GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d (FLUSH) on pad %s:%s",
+          GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
+
       if (GST_EVENT_FLUSH_DONE (event)) {
         GST_PAD_UNSET_FLUSHING (pad);
         GST_CAT_DEBUG (GST_CAT_EVENT, "cleared flush flag");
@@ -2933,6 +2934,9 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
       }
       break;
     default:
+      GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d on pad %s:%s",
+          GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
+
       if (GST_PAD_IS_FLUSHING (pad))
         goto flushing;
       break;
@@ -2962,7 +2966,7 @@ no_function:
 flushing:
   {
     GST_UNLOCK (pad);
-    GST_CAT_DEBUG (GST_CAT_EVENT, "received event on flushing pad");
+    GST_CAT_DEBUG (GST_CAT_EVENT, "Received event on flushing pad. Discarding");
     gst_event_unref (event);
     return FALSE;
   }
index 0d7bad7..f2f4d56 100644 (file)
@@ -762,8 +762,7 @@ load_feature (xmlTextReaderPtr reader)
 
           if (template) {
             GST_LOG ("adding template %s to factory %s",
-                GST_PAD_TEMPLATE_NAME_TEMPLATE (template),
-                GST_PLUGIN_FEATURE_NAME (feature));
+                template->name_template, GST_PLUGIN_FEATURE_NAME (feature));
             __gst_element_factory_add_static_pad_template (factory, template);
           }
         }
index 1bb130d..1eb7195 100644 (file)
@@ -514,7 +514,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
       }
       break;
     case MODE_NORMAL:
-      if (GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
+      if (FALSE) {              // GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
         start_typefinding (typefind);
         gst_event_unref (event);
         res = TRUE;