From 0c08a99a79e550a04c0a481f15db0dfdb6d3b852 Mon Sep 17 00:00:00 2001
From: Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Date: Sat, 13 Aug 2011 01:44:09 -0400
Subject: [PATCH] Fixes a pretty bad stereo bug in test_opus

---
 src/test_opus.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test_opus.c b/src/test_opus.c
index c1db8d72d..d1476d623 100644
--- a/src/test_opus.c
+++ b/src/test_opus.c
@@ -339,9 +339,9 @@ int main(int argc, char *argv[])
             if (feof(fin))
                 break;
         } else {
-            err = fread(in, sizeof(short), frame_size*channels, fin);
+            err = fread(in, sizeof(short)*channels, frame_size, fin);
             curr_read = err;
-            if (curr_read < frame_size*channels)
+            if (curr_read < frame_size)
             {
                 int i;
                 for (i=curr_read*channels;i<frame_size*channels;i++)
@@ -384,7 +384,7 @@ int main(int argc, char *argv[])
                 }
                 if (output_samples>0)
                 {
-                    fwrite(out+skip, sizeof(short), output_samples-skip*channels, fout);
+                    fwrite(out+skip, sizeof(short)*channels, output_samples-skip, fout);
                     skip = 0;
                 }
             }
-- 
GitLab