shithub: opus

Download patch

ref: 0c08a99a79e550a04c0a481f15db0dfdb6d3b852
parent: 86dd98409ff689597ef9859eb0919828136dce33
author: Jean-Marc Valin <[email protected]>
date: Fri Aug 12 21:44:09 EDT 2011

Fixes a pretty bad stereo bug in test_opus

--- a/src/test_opus.c
+++ b/src/test_opus.c
@@ -339,9 +339,9 @@
             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 @@
                 }
                 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;
                 }
             }