diff options
author | sruffell <sruffell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-20 19:57:22 +0000 |
---|---|---|
committer | sruffell <sruffell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-20 19:57:22 +0000 |
commit | b51a73f888aa8bb36d16269f6fb2c088b927fdc3 (patch) | |
tree | 3a36845887629f57627add7d9d9eff80d84ef084 /codecs/codec_dahdi.c | |
parent | 10d9fdf5b5621082bea781d53528b650c886d0e7 (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/trunk@139153 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_dahdi.c')
-rw-r--r-- | codecs/codec_dahdi.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/codecs/codec_dahdi.c b/codecs/codec_dahdi.c index a5fe89252..67627cf9b 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) @@ -111,6 +108,7 @@ static char *handle_cli_transcoder_show(struct ast_cli_entry *e, int cmd, struct if (copy.total == 0) ast_cli(a->fd, "No DAHDI transcoders found.\n"); + ast_debug(1, "codec_dahdi.so loaded.\n"); else ast_cli(a->fd, "%d/%d encoders/decoders of %d channels are in use.\n", copy.encoders, copy.decoders, copy.total); @@ -159,7 +157,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 +246,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; } @@ -446,6 +448,7 @@ static int unload_module(void) static int load_module(void) { + ast_debug(1, "codec_dahdi.so loaded.\n"); if (parse_config(0)) return AST_MODULE_LOAD_DECLINE; find_transcoders(); |