? .audiopanorama.c.swp
? .audiopanorama.h.swp
? audiopanorama.diff
Index: audiopanorama.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/audiofx/audiopanorama.c,v
retrieving revision 1.5
diff -u -p -r1.5 audiopanorama.c
--- audiopanorama.c	24 Aug 2006 19:00:22 -0000	1.5
+++ audiopanorama.c	8 Dec 2006 13:35:19 -0000
@@ -168,6 +168,7 @@ gst_audio_panorama_init (GstAudioPanoram
     GstAudioPanoramaClass * klass)
 {
   filter->panorama = 0;
+  filter->width = 0;
 }
 
 static void
@@ -253,7 +254,7 @@ gst_audio_panorama_set_caps (GstBaseTran
   GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base);
   const GstStructure *structure;
   gboolean ret;
-  gint channels;
+  gint channels, width;
   const gchar *fmt;
 
   /*GST_INFO ("incaps are %" GST_PTR_FORMAT, incaps); */
@@ -263,6 +264,12 @@ gst_audio_panorama_set_caps (GstBaseTran
   if (!ret)
     goto no_channels;
 
+  ret = gst_structure_get_int (structure, "width", &width);
+  if (!ret)
+    goto no_width;
+  filter->width = width / 8;
+  
+
   fmt = gst_structure_get_name (structure);
 
   GST_DEBUG ("try to process %s input with %d channels", fmt, channels);
@@ -297,6 +304,9 @@ gst_audio_panorama_set_caps (GstBaseTran
 no_channels:
   GST_DEBUG ("no channels in caps");
   return ret;
+no_width:
+  GST_DEBUG ("no width in caps");
+  return ret;
 }
 
 static void
@@ -434,7 +444,7 @@ gst_audio_panorama_transform (GstBaseTra
     GstBuffer * outbuf)
 {
   GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base);
-  guint num_samples = GST_BUFFER_SIZE (outbuf) / (2 * sizeof (gint16));
+  guint num_samples = GST_BUFFER_SIZE (outbuf) / (2 * filter->width);
 
   if (!gst_buffer_is_writable (outbuf))
     return GST_FLOW_OK;
Index: audiopanorama.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/gst/audiofx/audiopanorama.h,v
retrieving revision 1.3
diff -u -p -r1.3 audiopanorama.h
--- audiopanorama.h	24 Aug 2006 19:00:22 -0000	1.3
+++ audiopanorama.h	8 Dec 2006 13:35:19 -0000
@@ -45,6 +45,7 @@ struct _GstAudioPanorama {
   
   /* < private > */
   GstAudioPanoramaProcessFunc process;
+  gint width;
 };
 
 struct _GstAudioPanoramaClass {
