[asterisk-commits] sruffell: branch 1.4 r139151 - /branches/1.4/codecs/codec_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Aug 20 14:52:25 CDT 2008
Author: sruffell
Date: Wed Aug 20 14:52:25 2008
New Revision: 139151
URL: http://svn.digium.com/view/asterisk?view=rev&rev=139151
Log:
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.
Modified:
branches/1.4/codecs/codec_dahdi.c
Modified: branches/1.4/codecs/codec_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/codec_dahdi.c?view=diff&rev=139151&r1=139150&r2=139151
==============================================================================
--- branches/1.4/codecs/codec_dahdi.c (original)
+++ branches/1.4/codecs/codec_dahdi.c Wed Aug 20 14:52:25 2008
@@ -108,11 +108,7 @@
struct pvt {
int fd;
int fake;
- unsigned int g729b_warning:1;
-#ifdef DEBUG_TRANSCODE
- int totalms;
- int lasttotalms;
-#endif
+ int samples;
struct dahdi_transcoder_formats fmts;
};
@@ -172,7 +168,7 @@
return NULL;
}
} else {
- pvt->f.samples = res;
+ pvt->f.samples = ztp->samples;
pvt->f.datalen = res;
pvt->datalen = 0;
pvt->f.frametype = AST_FRAME_VOICE;
@@ -268,6 +264,20 @@
switch (ztp->fmts.dstfmt) {
case AST_FORMAT_G729A:
+ ztp->samples = 160;
+ break;
+ case AST_FORMAT_G723_1:
+ ztp->samples = 240;
+ break;
+ default:
+ ztp->samples = 160;
+ break;
+ };
+
+ switch (ztp->fmts.dstfmt) {
+ case AST_FORMAT_G729A:
+ ast_atomic_fetchadd_int(&channels.encoders, +1);
+ break;
case AST_FORMAT_G723_1:
ast_atomic_fetchadd_int(&channels.encoders, +1);
break;
More information about the asterisk-commits
mailing list