]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
resample filter: Don't discard const.
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Dec 2017 13:50:28 +0000 (14:50 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 31 Dec 2017 13:52:32 +0000 (14:52 +0100)
Newer versions of libsamplerate made the data_in pointer const. This
causes the following warning:

In file included from resample_filter.c:6:0:
/usr/local/include/samplerate.h:177:6: note: expected 'float *' but argument is of type 'const float *'
 void src_short_to_float_array (const short *in, float *out, int len) ;
      ^
resample_filter.c:173:7: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
In file included from para.h:11:0,
 from resample_filter.c:10:
/usr/include/stdlib.h:460:13: note: expected 'void *' but argument is of type 'const float *'
 extern void free (void *__ptr) __THROW;

The problem is that we first convert the input from int16 to float
and use the data_in pointer as the target for the conversion.

Fix this by introducing a temporary non-const variable for the
converted input.


No differences found