src/audio/SDL_wave.c
changeset 7313 c7346a060a7d
parent 7037 3fedf1f25b94
child 7677 871d43c6968a
     1.1 --- a/src/audio/SDL_wave.c	Tue Jun 18 00:39:47 2013 -0700
     1.2 +++ b/src/audio/SDL_wave.c	Tue Jun 18 00:50:35 2013 -0700
     1.3 @@ -273,6 +273,11 @@
     1.4      Sint32 delta, step;
     1.5  
     1.6      /* Compute difference and new sample value */
     1.7 +    if (state->index > 88) {
     1.8 +        state->index = 88;
     1.9 +    } else if (state->index < 0) {
    1.10 +        state->index = 0;
    1.11 +    }
    1.12      step = step_table[state->index];
    1.13      delta = step >> 3;
    1.14      if (nybble & 0x04)
    1.15 @@ -287,11 +292,6 @@
    1.16  
    1.17      /* Update index value */
    1.18      state->index += index_table[nybble];
    1.19 -    if (state->index > 88) {
    1.20 -        state->index = 88;
    1.21 -    } else if (state->index < 0) {
    1.22 -        state->index = 0;
    1.23 -    }
    1.24  
    1.25      /* Clamp output sample */
    1.26      if (state->sample > max_audioval) {