Fixes the case of PLC before receiving any valid packet
authorKoen Vos <koen.vos@skype.net>
Fri, 27 May 2011 02:23:46 +0000 (22:23 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Fri, 27 May 2011 02:23:46 +0000 (22:23 -0400)
silk/silk_dec_API.c

index 652f866..eb456f3 100644 (file)
@@ -112,7 +112,11 @@ SKP_int silk_Decode(
     for( n = 0; n < decControl->nChannelsInternal; n++ ) {\r
         if( channel_state[ n ].nFramesDecoded == 0 ) {\r
             SKP_int fs_kHz_dec;\r
-            if( decControl->payloadSize_ms == 10 ) {\r
+            if( decControl->payloadSize_ms == 0 ) {\r
+                /* Assuming packet loss, use 10 ms */\r
+                channel_state[ n ].nFramesPerPacket = 1;\r
+                channel_state[ n ].nb_subfr = 2;\r
+            } else if( decControl->payloadSize_ms == 10 ) {\r
                 channel_state[ n ].nFramesPerPacket = 1;\r
                 channel_state[ n ].nb_subfr = 2;\r
             } else if( decControl->payloadSize_ms == 20 ) {\r