Merge "res_pjsip_mwi: Turn some NOTICEs and WARNINGs into debug 1s."
[asterisk/asterisk.git] / codecs / codec_resample.c
index 67e9ce2..1c73bf3 100644 (file)
@@ -38,7 +38,7 @@ ASTERISK_REGISTER_FILE()
 #include "asterisk/translate.h"
 #include "asterisk/slin.h"
 
-#define OUTBUF_SIZE   8096
+#define OUTBUF_SAMPLES   11520
 
 static struct ast_translator *translators;
 static int trans_size;
@@ -114,7 +114,7 @@ static void resamp_destroy(struct ast_trans_pvt *pvt)
 static int resamp_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
 {
        SpeexResamplerState *resamp_pvt = pvt->pvt;
-       unsigned int out_samples = (OUTBUF_SIZE / sizeof(int16_t)) - pvt->samples;
+       unsigned int out_samples = OUTBUF_SAMPLES - pvt->samples;
        unsigned int in_samples;
 
        if (!f->datalen) {
@@ -167,8 +167,8 @@ static int load_module(void)
                        translators[idx].destroy = resamp_destroy;
                        translators[idx].framein = resamp_framein;
                        translators[idx].desc_size = 0;
-                       translators[idx].buffer_samples = (OUTBUF_SIZE / sizeof(int16_t));
-                       translators[idx].buf_size = OUTBUF_SIZE;
+                       translators[idx].buffer_samples = OUTBUF_SAMPLES;
+                       translators[idx].buf_size = (OUTBUF_SAMPLES * sizeof(int16_t));
                        memcpy(&translators[idx].src_codec, &codec_list[x], sizeof(struct ast_codec));
                        memcpy(&translators[idx].dst_codec, &codec_list[y], sizeof(struct ast_codec));
                        snprintf(translators[idx].name, sizeof(translators[idx].name), "slin %ukhz -> %ukhz",