aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsruffell <sruffell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-20 20:12:38 +0000
committersruffell <sruffell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-20 20:12:38 +0000
commit06240d93e5e7353af0695b55a8875fb370f28c58 (patch)
treeb14420bbb4064a4e7145641018c4108be990aafb
parent79b63cf518c2e19356aeca2ec61c9c6bef4e8882 (diff)
Fix bug where the samples were not accurate when in G723 mode, which would
cause the timestamp field of the RTP header to be invalid. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@139155 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--codecs/codec_dahdi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/codecs/codec_dahdi.c b/codecs/codec_dahdi.c
index c74a658ee..84cef6163 100644
--- a/codecs/codec_dahdi.c
+++ b/codecs/codec_dahdi.c
@@ -82,11 +82,8 @@ static AST_LIST_HEAD_STATIC(translators, translator);
struct pvt {
int fd;
int fake;
-#ifdef DEBUG_TRANSCODE
- int totalms;
- int lasttotalms;
-#endif
struct dahdi_transcoder_formats fmts;
+ int samples;
};
static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -159,7 +156,7 @@ static struct ast_frame *dahdi_frameout(struct ast_trans_pvt *pvt)
return NULL;
}
} else {
- pvt->f.samples = res;
+ pvt->f.samples = dahdip->samples;
pvt->f.datalen = res;
pvt->datalen = 0;
pvt->f.frametype = AST_FRAME_VOICE;
@@ -248,10 +245,14 @@ static int dahdi_translate(struct ast_trans_pvt *pvt, int dest, int source)
switch (dahdip->fmts.dstfmt) {
case AST_FORMAT_G729A:
+ dahdip->samples = 160;
+ break;
case AST_FORMAT_G723_1:
+ dahdip->samples = 240;
ast_atomic_fetchadd_int(&channels.encoders, +1);
break;
default:
+ dahdip->samples = 160;
ast_atomic_fetchadd_int(&channels.decoders, +1);
break;
}