aboutsummaryrefslogtreecommitdiffstats
path: root/codecs/codec_g723_1.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-04 16:33:56 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-04-04 16:33:56 +0000
commit4b4f3fb74075a03e96c8b587b5e583e034d006c1 (patch)
treed7eb535fef89266ada364baf7552f77100cfdeaf /codecs/codec_g723_1.c
parentaca93f2302c902549925f1d988be993dc1b8dac0 (diff)
Minor samples updates
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2611 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_g723_1.c')
-rwxr-xr-xcodecs/codec_g723_1.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/codecs/codec_g723_1.c b/codecs/codec_g723_1.c
index 3e96ad65f..0d793897f 100755
--- a/codecs/codec_g723_1.c
+++ b/codecs/codec_g723_1.c
@@ -115,7 +115,7 @@ static struct ast_frame *lintog723_sample(void)
f.subclass = AST_FORMAT_SLINEAR;
f.datalen = sizeof(slin_g723_ex);
/* Assume 8000 Hz */
- f.samples = sizeof(slin_g723_ex)/16;
+ f.samples = sizeof(slin_g723_ex)/2;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
@@ -130,7 +130,7 @@ static struct ast_frame *g723tolin_sample(void)
f.subclass = AST_FORMAT_G723_1;
f.datalen = sizeof(g723_slin_ex);
/* All frames are 30 ms long */
- f.samples = 30;
+ f.samples = 240;
f.mallocd = 0;
f.offset = 0;
f.src = __PRETTY_FUNCTION__;
@@ -167,7 +167,7 @@ static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
tmp->f.subclass = AST_FORMAT_SLINEAR;
tmp->f.datalen = tmp->tail * 2;
/* Assume 8000 Hz */
- tmp->f.samples = tmp->tail / 8;
+ tmp->f.samples = tmp->tail;
tmp->f.mallocd = 0;
tmp->f.offset = AST_FRIENDLY_OFFSET;
tmp->f.src = __PRETTY_FUNCTION__;
@@ -296,9 +296,8 @@ static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
Coder(&tmp->cod, tmp->buf, tmp->outbuf + cnt);
#endif
/* Assume 8000 Hz */
- tmp->f.samples += 30;
- /* FIXME:SLD: Shouldn't the [0] be [cnt]?? */
- cnt += g723_len(tmp->outbuf[0]);
+ tmp->f.samples += 240;
+ cnt += g723_len(tmp->outbuf[cnt]);
tmp->tail -= Frame;
/* Move the data at the end of the buffer to the front */
if (tmp->tail)