[asterisk-commits] sruffell: branch 1.6.0 r139155 - /branches/1.6.0/codecs/codec_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 20 15:12:38 CDT 2008


Author: sruffell
Date: Wed Aug 20 15:12:38 2008
New Revision: 139155

URL: http://svn.digium.com/view/asterisk?view=rev&rev=139155
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.6.0/codecs/codec_dahdi.c

Modified: branches/1.6.0/codecs/codec_dahdi.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/codecs/codec_dahdi.c?view=diff&rev=139155&r1=139154&r2=139155
==============================================================================
--- branches/1.6.0/codecs/codec_dahdi.c (original)
+++ branches/1.6.0/codecs/codec_dahdi.c Wed Aug 20 15:12:38 2008
@@ -82,11 +82,8 @@
 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 @@
 				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 @@
 
 	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;
 	}




More information about the asterisk-commits mailing list