shithub: aubio

Download patch

ref: 6a253e8b3897133c553877f8633f339a537fb28b
parent: 7dea72fcd306af951324421ed981464cdfa71fa2
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 14:05:41 EST 2018

[source_wavread] use padding helpers

--- a/src/io/source_wavread.c
+++ b/src/io/source_wavread.c
@@ -377,11 +377,9 @@
       s->read_index += end;
     }
   }
-  if (total_wrote < length) {
-    for (i = end; i < length; i++) {
-      read_data->data[i] = 0.;
-    }
-  }
+
+  aubio_source_pad_output (read_data, total_wrote);
+
   *read = total_wrote;
 }
 
@@ -418,13 +416,9 @@
       s->read_index += end;
     }
   }
-  if (total_wrote < length) {
-    for (j = 0; j < read_data->height; j++) {
-      for (i = end; i < length; i++) {
-        read_data->data[j][i] = 0.;
-      }
-    }
-  }
+
+  aubio_source_pad_multi_output(read_data, s->input_channels, total_wrote);
+
   *read = total_wrote;
 }