projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b40c149
)
[source_sndfile] avoid declaration after statement
author
Paul Brossier
<piem@piem.org>
Sat, 22 Dec 2018 23:48:19 +0000
(
00:48
+0100)
committer
Paul Brossier
<piem@piem.org>
Sat, 22 Dec 2018 23:48:19 +0000
(
00:48
+0100)
src/io/source_sndfile.c
patch
|
blob
|
history
diff --git
a/src/io/source_sndfile.c
b/src/io/source_sndfile.c
index
d2b98a5
..
3984465
100644
(file)
--- 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);
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);
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;
}
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;
#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);
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);
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;
}
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;
#ifdef HAVE_SAMPLERATE
if (s->ratio != 1) {
ptr_data = s->input_mat->data;