gst/adder/gstadder.c: fix adder for float elements
authorStefan Kost <ensonic@users.sourceforge.net>
Wed, 28 Sep 2005 18:59:19 +0000 (18:59 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Wed, 28 Sep 2005 18:59:19 +0000 (18:59 +0000)
Original commit message from CVS:
* gst/adder/gstadder.c: (gst_adder_collected):
fix adder for float elements

ChangeLog
gst/adder/gstadder.c

index 92c54fa..0a397b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-28  Stefan Kost  <ensonic@users.sf.net>
+
+       * gst/adder/gstadder.c: (gst_adder_collected):
+          fix adder for float elements
+
 2005-09-28  Wim Taymans  <wim@fluendo.com>
 
        * gst-libs/gst/audio/gstbaseaudiosink.c:
index 8d44864..33e2e18 100644 (file)
@@ -375,10 +375,8 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
   {
     guint64 duration;
 
-    if (adder->format == GST_ADDER_FORMAT_FLOAT)
-      duration = size / adder->width / adder->channels;
-    else
-      duration = size * 8 / adder->width / adder->channels;
+    /* width is in bits and we need bytes */
+    duration = size * (adder->width / 8) / adder->channels;
 
     GST_BUFFER_TIMESTAMP (outbuf) = adder->timestamp;
     GST_BUFFER_OFFSET (outbuf) = adder->offset;