? ext/ladspa/core.8453
? ext/ladspa/core.9900
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.2478
diff -u -r1.2478 ChangeLog
--- ChangeLog	8 Aug 2006 14:46:00 -0000	1.2478
+++ ChangeLog	8 Aug 2006 19:54:23 -0000
@@ -1,3 +1,20 @@
+2006-08-08  Andy Wingo  <wingo@pobox.com>
+
+	* ext/ladspa/gstladspa.c (gst_ladspa_base_init): Accept >, <, and
+	= in pad names. Prevents a case, for example in comp_ac in
+	comparison_4440, where canonicalizing port names leads to
+	duplicate names. Not exhaustive, however. Fixes #349901.
+
+	* ext/ladspa/gstsignalprocessor.c (gst_signal_processor_setup)
+	(gst_signal_processor_start, gst_signal_processor_stop)
+	(gst_signal_processor_cleanup): More debug. Clear pad caps when
+	stopping to force set_caps() before process().
+	(gst_signal_processor_setcaps): Be more robust under
+	PLAYING->READY->PLAYING, among other situations. Fixes #350006.
+	(gst_signal_processor_flush): Debug.
+	(gst_signal_processor_change_state): Flush penned data when going
+	to READY.
+
 2006-08-08  Tim-Philipp Müller  <tim at centricular dot net>
 
 	* ext/jpeg/gstsmokedec.c: (gst_smokedec_chain):
Index: ext/ladspa/gstladspa.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ext/ladspa/gstladspa.c,v
retrieving revision 1.58
diff -u -r1.58 gstladspa.c
--- ext/ladspa/gstladspa.c	4 Aug 2006 11:38:54 -0000	1.58
+++ ext/ladspa/gstladspa.c	8 Aug 2006 19:54:23 -0000
@@ -91,7 +91,7 @@
     if (LADSPA_IS_PORT_AUDIO (p)) {
       gchar *name = g_strdup ((gchar *) desc->PortNames[j]);
 
-      g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-", '-');
+      g_strcanon (name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-><=", '-');
 
       if (LADSPA_IS_PORT_INPUT (p))
         gst_signal_processor_class_add_pad_template (gsp_class, name,
Index: ext/ladspa/gstsignalprocessor.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ext/ladspa/gstsignalprocessor.c,v
retrieving revision 1.15
diff -u -r1.15 gstsignalprocessor.c
--- ext/ladspa/gstsignalprocessor.c	4 Aug 2006 11:38:54 -0000	1.15
+++ ext/ladspa/gstsignalprocessor.c	8 Aug 2006 19:54:23 -0000
@@ -275,6 +275,8 @@
 
   klass = GST_SIGNAL_PROCESSOR_GET_CLASS (self);
 
+  GST_INFO_OBJECT (self, "setup()");
+
   g_return_val_if_fail (self->state == GST_SIGNAL_PROCESSOR_STATE_NULL, FALSE);
 
   if (klass->setup)
@@ -305,6 +307,8 @@
   g_return_val_if_fail (self->state == GST_SIGNAL_PROCESSOR_STATE_INITIALIZED,
       FALSE);
 
+  GST_INFO_OBJECT (self, "start()");
+
   if (klass->start)
     ret = klass->start (self);
 
@@ -326,14 +330,23 @@
 gst_signal_processor_stop (GstSignalProcessor * self)
 {
   GstSignalProcessorClass *klass;
+  GstElement *elem;
+  GList *sinks;
 
   klass = GST_SIGNAL_PROCESSOR_GET_CLASS (self);
+  elem = GST_ELEMENT (self);
+
+  GST_INFO_OBJECT (self, "stop()");
 
   g_return_if_fail (self->state == GST_SIGNAL_PROCESSOR_STATE_RUNNING);
 
   if (klass->stop)
     klass->stop (self);
 
+  for (sinks = elem->sinkpads; sinks; sinks = sinks->next)
+    /* force set_caps when going to RUNNING, see note in set_caps */
+    gst_pad_set_caps (GST_PAD (sinks->data), NULL);
+
   /* should also flush our buffers perhaps? */
 
   self->state = GST_SIGNAL_PROCESSOR_STATE_INITIALIZED;
@@ -346,6 +359,8 @@
 
   klass = GST_SIGNAL_PROCESSOR_GET_CLASS (self);
 
+  GST_INFO_OBJECT (self, "cleanup()");
+
   g_return_if_fail (self->state == GST_SIGNAL_PROCESSOR_STATE_INITIALIZED);
 
   if (klass->cleanup)
@@ -363,7 +378,7 @@
 
   /* the whole processor has one caps; if the sample rate changes, let subclass
      implementations know */
-  if (caps != self->caps) {
+  if (!gst_caps_is_equal (caps, self->caps)) {
     GstStructure *s;
     gint sample_rate;
 
@@ -375,10 +390,13 @@
       GST_DEBUG_OBJECT (self, "Got rate=%d", sample_rate);
     }
 
+    if (GST_SIGNAL_PROCESSOR_IS_RUNNING (self))
+      gst_signal_processor_stop (self);
+    if (GST_SIGNAL_PROCESSOR_IS_INITIALIZED (self))
+      gst_signal_processor_cleanup (self);
+    
     if (!gst_signal_processor_setup (self, sample_rate)) {
       goto start_failed;
-    } else if (!gst_signal_processor_start (self)) {
-      goto start_failed;
     } else {
       self->sample_rate = sample_rate;
       gst_caps_replace (&self->caps, caps);
@@ -387,7 +405,17 @@
     GST_DEBUG_OBJECT (self, "skipping, have caps already");
   }
 
-  /* FIXME: handle was_active, etc */
+  /* we use this method to manage the processor's state, hence the caps clearing
+     in stop(). so it can be that we enter here just to manage the processor's
+     state, to take it to RUNNING from already being INITIALIZED with the right
+     sample rate (e.g., when having gone PLAYING->READY->PLAYING). make sure
+     when we leave that the processor is RUNNING. */
+  if (!GST_SIGNAL_PROCESSOR_IS_INITIALIZED (self)
+      && !gst_signal_processor_setup (self, self->sample_rate))
+      goto start_failed;
+  if (!GST_SIGNAL_PROCESSOR_IS_RUNNING (self)
+      && !gst_signal_processor_start (self))
+      goto start_failed;
 
   gst_object_unref (self);
 
@@ -604,6 +632,8 @@
 
   pads = GST_ELEMENT (self)->pads;
 
+  GST_INFO_OBJECT (self, "flush()");
+
   for (pads = GST_ELEMENT (self)->pads; pads; pads = pads->next) {
     GstSignalProcessorPad *spad = (GstSignalProcessorPad *) pads->data;
 
@@ -898,6 +928,7 @@
     case GST_STATE_CHANGE_PAUSED_TO_READY:
       if (GST_SIGNAL_PROCESSOR_IS_RUNNING (self))
         gst_signal_processor_stop (self);
+      gst_signal_processor_flush (self);
       break;
     case GST_STATE_CHANGE_READY_TO_NULL:
       if (GST_SIGNAL_PROCESSOR_IS_INITIALIZED (self))
