]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 65877 via svnmerge from
authorJason Parker <jparker@digium.com>
Thu, 24 May 2007 15:28:29 +0000 (15:28 +0000)
committerJason Parker <jparker@digium.com>
Thu, 24 May 2007 15:28:29 +0000 (15:28 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r65877 | qwell | 2007-05-24 11:14:02 -0400 (Thu, 24 May 2007) | 4 lines

Fix handling of zero-length frames when a codec is capable of native PLC.

Issue 9183, patch by Mihai.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65903 65c4cc65-6c06-0410-ace0-fbb531ad65f3

.cleancount
codecs/codec_ilbc.c
codecs/codec_speex.c
include/asterisk/translate.h
main/translate.c

index 64bb6b746dceaf12b0ba8c08f310b0426babde44..e85087affded170efcbc6f9672a6fc671d839ed0 100644 (file)
@@ -1 +1 @@
-30
+31
index 34847fcc70e9f68b4fd28e18e94f94cf678e6c38..637f22d122adbd6065d810efaf71ad7dc09ff909 100644 (file)
@@ -203,6 +203,7 @@ static struct ast_translator ilbctolin = {
        .sample = ilbctolin_sample,
        .desc_size = sizeof(struct ilbc_coder_pvt),
        .buf_size = BUFFER_SAMPLES * 2,
+       .native_plc = 1,
 };
 
 static struct ast_translator lintoilbc = {
index c08de587967e59b437df13bcc18fbe5c8c51ee76..182b33eb980fc8e44b94208dca75d62cca612558 100644 (file)
@@ -358,6 +358,7 @@ static struct ast_translator speextolin = {
        .desc_size = sizeof(struct speex_coder_pvt),
        .buffer_samples = BUFFER_SAMPLES,
        .buf_size = BUFFER_SAMPLES * 2,
+       .native_plc = 1,
 };
 
 static struct ast_translator lintospeex = {
index 5e28c6236cbd10235895cb10d6b72c4a473dcb17..ec939e6b59958ee2f4d7e9ed29d14f8ee1f90f74 100644 (file)
@@ -104,6 +104,7 @@ struct ast_translator {
        int desc_size;                  /*!< size of private descriptor in pvt->pvt, if any */
        int plc_samples;                /*!< set to the plc block size if used, 0 otherwise */
        int useplc;                     /*!< current status of plc, changed at runtime */
+       int native_plc;                 /*!< true if the translator can do native plc */
 
        struct ast_module *module;      /* opaque reference to the parent module */
 
index c7387a713d8578cd3a63a3a3ce6a7a2de7deaef7..7ed772458d298e109c9353ac4fa4c95364db7342 100644 (file)
@@ -174,7 +174,9 @@ static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
                                pvt->samples += l;
                                pvt->datalen = pvt->samples * 2;        /* SLIN has 2bytes for 1sample */
                        }
-                       return 0;
+                       /* We don't want generic PLC. If the codec has native PLC, then do that */
+                       if (!pvt->t->native_plc)
+                               return 0;
                }
                if (pvt->samples + f->samples > pvt->t->buffer_samples) {
                        ast_log(LOG_WARNING, "Out of buffer space\n");