  #define SHL(a,shift) ((spx_word32_t)(a) << (shift))
  #define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift))
 diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c
-index 3588f7b..ad59b97 100644
+index aa0d9a0..825e3c4 100644
 --- a/libspeexdsp/resample.c
 +++ b/libspeexdsp/resample.c
 @@ -99,6 +99,10 @@ static void speex_free (void *ptr) {free(ptr);}

 [if test "$enableval" = yes; then
   has_char16=yes;
diff --git a/libspeexdsp/resample.c b/libspeexdsp/resample.c
index 7121445..3588f7b 100644
--- a/libspeexdsp/resample.c
+++ b/libspeexdsp/resample.c
@@ -585,7 +585,11 @@ static void update_filter(SpeexResamplerState *st)
    }
    
    /* Choose the resampling type that requires the least amount of memory */

 */
+      sum = SATURATE32PSHR(sum, 15, 32767);
 #else
       sum = inner_product_single(sinct, iptr, N);
 #endif
 
-      out[out_stride * out_sample++] = SATURATE32(PSHR32(sum, 15), 32767);
