From: Paul Brossier Date: Sat, 22 Dec 2018 23:48:19 +0000 (+0100) Subject: [source_sndfile] avoid declaration after statement X-Git-Tag: 0.4.9~19 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=e136c9f688671d2a688b39e4dce2590b09c84c91;p=aubio.git [source_sndfile] avoid declaration after statement --- diff --git a/src/io/source_sndfile.c b/src/io/source_sndfile.c index d2b98a5c..3984465f 100644 --- a/src/io/source_sndfile.c +++ b/src/io/source_sndfile.c @@ -174,6 +174,11 @@ void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uin s->hop_size, read_data->length); sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data, s->scratch_size); + uint_t read_length = read_samples / s->input_channels; + + /* where to store de-interleaved data */ + smpl_t *ptr_data; + if (!s->handle) { AUBIO_ERR("source_sndfile: could not read from %s (file was closed)\n", s->path); @@ -181,10 +186,6 @@ void aubio_source_sndfile_do(aubio_source_sndfile_t * s, fvec_t * read_data, uin return; } - uint_t read_length = read_samples / s->input_channels; - - /* where to store de-interleaved data */ - smpl_t *ptr_data; #ifdef HAVE_SAMPLERATE if (s->ratio != 1) { ptr_data = s->input_data->data; @@ -225,6 +226,11 @@ void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat s->path, s->input_channels, read_data->height); sf_count_t read_samples = aubio_sf_read_smpl (s->handle, s->scratch_data, s->scratch_size); + uint_t read_length = read_samples / s->input_channels; + + /* where to store de-interleaved data */ + smpl_t **ptr_data; + if (!s->handle) { AUBIO_ERR("source_sndfile: could not read from %s (file was closed)\n", s->path); @@ -232,10 +238,6 @@ void aubio_source_sndfile_do_multi(aubio_source_sndfile_t * s, fmat_t * read_dat return; } - uint_t read_length = read_samples / s->input_channels; - - /* where to store de-interleaved data */ - smpl_t **ptr_data; #ifdef HAVE_SAMPLERATE if (s->ratio != 1) { ptr_data = s->input_mat->data;