shithub: aubio

Download patch

ref: 7dea72fcd306af951324421ed981464cdfa71fa2
parent: 2a94ecaa7259f4ba7089347cf540f38250f25a64
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 14:05:29 EST 2018

[source_sndfile] use padding helpers

--- a/src/io/source_sndfile.c
+++ b/src/io/source_sndfile.c
@@ -205,11 +205,7 @@
 
   *read = (int)FLOOR(s->ratio * length + .5);
 
-  if (*read < read_data->length) {
-    for (j = *read; j < read_data->length; j++) {
-      read_data->data[j] = 0;
-    }
-  }
+  aubio_source_pad_output (read_data, *read);
 
 }
 
@@ -257,14 +253,7 @@
 
   *read = (int)FLOOR(s->ratio * length + .5);
 
-  if (*read < read_data->length) {
-    for (i = 0; i < read_data->height; i++) {
-      for (j = *read; j < read_data->length; j++) {
-        read_data->data[i][j] = 0.;
-      }
-    }
-  }
-
+  aubio_source_pad_multi_output(read_data, input_channels, *read);
 }
 
 uint_t aubio_source_sndfile_get_samplerate(aubio_source_sndfile_t * s) {