prevents wierd things from happening when a large number of packets are missing
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sun, 16 Oct 2005 14:50:37 +0000 (14:50 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sun, 16 Oct 2005 14:50:37 +0000 (14:50 +0000)
(or a disconnect)

git-svn-id: http://svn.xiph.org/trunk/speex@10164 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/nb_celp.c

index c6acdf6..db179d4 100644 (file)
@@ -1193,6 +1193,8 @@ static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
       pitch_val = st->last_pitch + SHR32((spx_int32_t)speex_rand(1+st->count_lost, &st->seed),SIG_SHIFT);
       if (pitch_val > st->max_pitch)
          pitch_val = st->max_pitch;
+      if (pitch_val < st->min_pitch)
+         pitch_val = st->min_pitch;
       for (i=0;i<st->subframeSize;i++)
       {
          exc[i]= MULT16_32_Q15(pitch_gain, (exc[i-pitch_val]+VERY_SMALL)) +