fixed a bug when a packet is lost and submode-encoding is disabled.
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sun, 12 Feb 2006 10:40:21 +0000 (10:40 +0000)
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Sun, 12 Feb 2006 10:40:21 +0000 (10:40 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@10802 0101bb08-14d6-0310-b084-bc0e0c8e3800

libspeex/nb_celp.c

index 1b19f6a..f6f5c69 100644 (file)
@@ -1277,12 +1277,6 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
    st=(DecState*)state;
    stack=st->stack;
 
-   if (st->encode_submode)
-   {
-#ifdef EPIC_48K
-   if (!st->lbr_48k) {
-#endif
-
    /* Check if we're in DTX mode*/
    if (!bits && st->dtx_enabled)
    {
@@ -1296,6 +1290,12 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
          return 0;
       }
 
+      if (st->encode_submode)
+      {
+#ifdef EPIC_48K
+         if (!st->lbr_48k) {
+#endif
+
       /* Search for next narrowband block (handle requests, skip wideband blocks) */
       do {
          if (speex_bits_remaining(bits)<5)
@@ -1365,11 +1365,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
 
       /* Get the sub-mode that was used */
       st->submodeID = m;
-
-   }
 #ifdef EPIC_48K
-   }
+         }
 #endif
+      }
+
    }
 
    /* Shift all buffers by one frame */