shithub: aubio

Download patch

ref: 1ddb9d1f40161df689a684f530fa91c9c043d270
parent: 6f22ed5c3c6b6d87c6f034b6f2f70e98b2211735
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 14:17:58 EST 2018

[io] source_pad_do_output to pad extra channels

--- a/src/io/ioutils.c
+++ b/src/io/ioutils.c
@@ -111,6 +111,15 @@
           read_data->length - source_read);
     }
   }
+
+  // destination matrix has more channels than the file
+  // copy channels from the source to extra output channels
+  if (read_data->height > source_channels) {
+    for (i = source_channels; i < read_data->height; i++) {
+      AUBIO_MEMCPY(read_data->data[i], read_data->data[i % source_channels],
+          sizeof(smpl_t) * read_data->length);
+    }
+  }
 }
 
 uint_t