From 6a253e8b3897133c553877f8633f339a537fb28b Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 20 Dec 2018 19:05:41 +0100 Subject: [PATCH] [source_wavread] use padding helpers --- src/io/source_wavread.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/io/source_wavread.c b/src/io/source_wavread.c index b893619b..31e3770e 100644 --- a/src/io/source_wavread.c +++ b/src/io/source_wavread.c @@ -377,11 +377,9 @@ void aubio_source_wavread_do(aubio_source_wavread_t * s, fvec_t * read_data, uin 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 @@ void aubio_source_wavread_do_multi(aubio_source_wavread_t * s, fmat_t * read_dat 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; } -- 2.11.0