Fix monoscope: caps already asked for mono input: make it actually expect such input.
authorRichard Boulton <richard@tartarus.org>
Sun, 3 Mar 2002 17:29:59 +0000 (17:29 +0000)
committerRichard Boulton <richard@tartarus.org>
Sun, 3 Mar 2002 17:29:59 +0000 (17:29 +0000)
Original commit message from CVS:
Fix monoscope: caps already asked for mono input: make it actually expect
such input.

gst/monoscope/monoscope.c
gst/monoscope/monoscope.h

index 33c3e98..af942ac 100644 (file)
@@ -25,7 +25,6 @@
 #define scope_width 256
 #define scope_height 128
 
-static gint16 newEq[CONVOLVE_BIG];      // latest block of 512 samples.
 static gint16 copyEq[CONVOLVE_BIG];
 static int avgEq[CONVOLVE_SMALL];      // a running average of the last few.
 static int avgMax;                     // running average of max sample.
@@ -50,7 +49,7 @@ void monoscope_init (guint32 resx, guint32 resy)
     colors_init(colors);
 }
 
-guint32 * monoscope_update (gint16 data [2][512])
+guint32 * monoscope_update (gint16 data [512])
 {
     /* Note that CONVOLVE_BIG must == data size here, ie 512. */
     /* Really, we want samples evenly spread over the available data.
@@ -59,19 +58,14 @@ guint32 * monoscope_update (gint16 data [2][512])
     int foo;
     int bar;  
     int h;
-    guchar bits[ 257 * 129];
     guint32 *loc;
 
        int factor;
        int val;
        int max = 1;
        short * thisEq;
-    for (i = 0; i < CONVOLVE_BIG; i++) {
-       /* Average the two channels. */
-       newEq[i] = (((int) data[0][i]) + (int) data[1][i]) >> 1;
-    }
 
-       memcpy (copyEq, newEq, sizeof (short) * CONVOLVE_BIG);
+       memcpy (copyEq, data, sizeof (short) * CONVOLVE_BIG);
        thisEq = copyEq;
 #if 1                                  
        val = convolve_match (avgEq, copyEq, state);
index 95ccf11..29fdf10 100644 (file)
@@ -4,7 +4,7 @@
 #include <glib.h>
 
 void monoscope_init (guint32 resx, guint32 resy);
-guint32 * monoscope_update (gint16 data [2][512]);
+guint32 * monoscope_update (gint16 data [512]);
 void monoscope_close ();
 
 #endif