shithub: aubio

Download patch

ref: 2510248607060ad6a30fb593c1db4a9e1b79f421
parent: 6a253e8b3897133c553877f8633f339a537fb28b
author: Paul Brossier <piem@piem.org>
date: Thu Dec 20 14:05:50 EST 2018

[source_avcodec] use padding helpers

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