summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurimas Liutikas <aurimas@google.com>2016-03-10 15:53:15 -0800
committerDirk Rettschlag <dirk.rettschlag@gmail.com>2016-03-23 09:25:58 +0100
commitca7a472058815913338dd93d82d6f7cdd3667a2c (patch)
tree9dc999c60434969fcc54282d1ebd65501885ddba
parentff03110e77ec7fe716c5be11783746f59c814e30 (diff)
downloadandroid_external_speex-ca7a472058815913338dd93d82d6f7cdd3667a2c.tar.gz
android_external_speex-ca7a472058815913338dd93d82d6f7cdd3667a2c.tar.bz2
android_external_speex-ca7a472058815913338dd93d82d6f7cdd3667a2c.zip
Bug: 26936282 Change-Id: Ic40ad35ef03ffb2c4cfa4e83f6036ce432da8257
-rw-r--r--Android.mk3
-rw-r--r--libspeex/resample.c13
2 files changed, 9 insertions, 7 deletions
diff --git a/Android.mk b/Android.mk
index 0e5c77e..a71db49 100644
--- a/Android.mk
+++ b/Android.mk
@@ -113,7 +113,8 @@ LOCAL_MODULE:= libspeex_googletts
LOCAL_SDK_VERSION := 14
LOCAL_CFLAGS+= -DEXPORT= -DFLOATING_POINT -DUSE_SMALLFT -DVAR_ARRAYS
-LOCAL_CFLAGS+= -O3 -fstrict-aliasing -fprefetch-loop-arrays
+LOCAL_CFLAGS+= -O3 -fstrict-aliasing -fprefetch-loop-arrays \
+ -Wno-unused-parameter -Werror
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/include
diff --git a/libspeex/resample.c b/libspeex/resample.c
index fa72d85..9339432 100644
--- a/libspeex/resample.c
+++ b/libspeex/resample.c
@@ -601,7 +601,7 @@ static void update_filter(SpeexResamplerState *st)
}
for (i=0;i<st->den_rate;i++)
{
- spx_int32_t j;
+ spx_uint32_t j;
for (j=0;j<st->filt_len;j++)
{
st->sinc_table[i*st->filt_len+j] = sinc(st->cutoff,((j-(spx_int32_t)st->filt_len/2+1)-((float)i)/st->den_rate), st->filt_len, quality_map[st->quality].window_func);
@@ -673,7 +673,7 @@ static void update_filter(SpeexResamplerState *st)
}
for (i=st->nb_channels-1;i>=0;i--)
{
- spx_int32_t j;
+ spx_uint32_t j;
spx_uint32_t olen = old_length;
/*if (st->magic_samples[i])*/
{
@@ -681,8 +681,9 @@ static void update_filter(SpeexResamplerState *st)
/* FIXME: This is wrong but for now we need it to avoid going over the array bounds */
olen = old_length + 2*st->magic_samples[i];
- for (j=old_length-2+st->magic_samples[i];j>=0;j--)
- st->mem[i*st->mem_alloc_size+j+st->magic_samples[i]] = st->mem[i*old_alloc_size+j];
+ spx_int32_t k;
+ for (k=old_length-2+st->magic_samples[i];k>=0;k--)
+ st->mem[i*st->mem_alloc_size+k+st->magic_samples[i]] = st->mem[i*old_alloc_size+k];
for (j=0;j<st->magic_samples[i];j++)
st->mem[i*st->mem_alloc_size+j] = 0;
st->magic_samples[i] = 0;
@@ -851,7 +852,7 @@ EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t cha
EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
#endif
{
- int j;
+ spx_uint32_t j;
spx_uint32_t ilen = *in_len;
spx_uint32_t olen = *out_len;
spx_word16_t *x = st->mem + channel_index * st->mem_alloc_size;
@@ -892,7 +893,7 @@ EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t c
EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
#endif
{
- int j;
+ spx_uint32_t j;
const int istride_save = st->in_stride;
const int ostride_save = st->out_stride;
spx_uint32_t ilen = *in_len;