From: Paul Brossier Date: Thu, 20 Dec 2018 18:05:41 +0000 (+0100) Subject: [source_wavread] use padding helpers X-Git-Tag: 0.4.9~60 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=6a253e8b3897133c553877f8633f339a537fb28b;p=aubio.git [source_wavread] use padding helpers --- 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; }