changeset 166:6ffdf5d4dfcf

Channel mix fixes
author Chris Cannam
date Thu, 02 May 2013 09:03:13 +0100
parents 84443da335f9
children 463437b9e625
files yetilab/stream/channels.yeti
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/yetilab/stream/channels.yeti	Wed May 01 22:19:36 2013 +0100
+++ b/yetilab/stream/channels.yeti	Thu May 02 09:03:13 2013 +0100
@@ -72,7 +72,7 @@
             for [0..columns-1] do col:
                 if target < channels then
                     v'[col * targetChannels + target] := v[col * channels + target];
-                elif channels == 1 then
+                elif channels == 1 and target == 1 then
                     v'[col * targetChannels + target] := v[col * channels];
                 fi
             done
@@ -84,8 +84,13 @@
     if targetChannels == 1 then
         mixedDown m
     else
-        interleaved
-           (mat.resizedTo { rows = targetChannels, columns = m.size.columns } m)
+       (interleaved .
+            mat.resizedTo { rows = targetChannels, columns = m.size.columns })
+            if m.size.rows == 1 then
+               (mat.newMatrix (RowMajor ()) [ m.getRow 0, m.getRow 0 ])
+            else
+                m
+            fi;
     fi;
 
 {