[asterisk-commits] codec resample: Increase buffer for Opus Codec. (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 3 12:38:14 CST 2015


Joshua Colp has submitted this change and it was merged.

Change subject: codec_resample: Increase buffer for Opus Codec.
......................................................................


codec_resample: Increase buffer for Opus Codec.

ASTERISK-25599 #close

Change-Id: I1f88a88c59fb4e1e62bbdbb100c7152d48e73f10
---
M codecs/codec_resample.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/codecs/codec_resample.c b/codecs/codec_resample.c
index 29d95a7..fd22707 100644
--- a/codecs/codec_resample.c
+++ b/codecs/codec_resample.c
@@ -38,7 +38,7 @@
 #include "asterisk/translate.h"
 #include "asterisk/slin.h"
 
-#define OUTBUF_SIZE   8096
+#define OUTBUF_SAMPLES   5760
 
 static struct ast_translator *translators;
 static int trans_size;
@@ -74,7 +74,7 @@
 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) {
@@ -127,8 +127,8 @@
 			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));
 			ast_format_set(&translators[idx].src_format, id_list[x], 0);
 			ast_format_set(&translators[idx].dst_format, id_list[y], 0);
 			snprintf(translators[idx].name, sizeof(translators[idx].name), "slin %dkhz -> %dkhz",

-- 
To view, visit https://gerrit.asterisk.org/1730
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f88a88c59fb4e1e62bbdbb100c7152d48e73f10
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list