[Asterisk-code-review] codec resample: Increase buffer for Opus Codec. (asterisk[master])

Alexander Traud asteriskteam at digium.com
Tue Dec 1 08:02:48 CST 2015


Alexander Traud has uploaded a new change for review.

  https://gerrit.asterisk.org/1728

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/28/1728/1

diff --git a/codecs/codec_resample.c b/codecs/codec_resample.c
index 67e9ce2..3c8a149 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;
@@ -114,7 +114,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) {
@@ -167,8 +167,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));
 			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",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f88a88c59fb4e1e62bbdbb100c7152d48e73f10
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>



More information about the asterisk-code-review mailing list