[Asterisk-code-review] codec resample: Increase buffer for Opus Codec. (asterisk[13])
Joshua Colp
asteriskteam at digium.com
Thu Dec 3 12:38:08 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 26b1f0e..fb06b82 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/1729
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f88a88c59fb4e1e62bbdbb100c7152d48e73f10
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: 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-code-review
mailing list