shithub: aubio

Download patch

ref: e136c9f688671d2a688b39e4dce2590b09c84c91
parent: b40c1497b3636748be1198357ba3c6c41f573e87
author: Paul Brossier <piem@piem.org>
date: Sat Dec 22 19:48:19 EST 2018

[source_sndfile] avoid declaration after statement

--- a/src/io/source_sndfile.c
+++ b/src/io/source_sndfile.c
@@ -174,6 +174,11 @@
       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 @@
     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 @@
       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 @@
     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;