[asterisk-commits] russell: branch russell/g722-sillyness r106496 - in /team/russell/g722-sillyn...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 6 17:25:18 CST 2008


Author: russell
Date: Thu Mar  6 17:25:18 2008
New Revision: 106496

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106496
Log:
Fix a couple more g722 sample issues ...

(issue #12130)

Modified:
    team/russell/g722-sillyness/codecs/codec_g722.c
    team/russell/g722-sillyness/main/rtp.c

Modified: team/russell/g722-sillyness/codecs/codec_g722.c
URL: http://svn.digium.com/view/asterisk/team/russell/g722-sillyness/codecs/codec_g722.c?view=diff&rev=106496&r1=106495&r2=106496
==============================================================================
--- team/russell/g722-sillyness/codecs/codec_g722.c (original)
+++ team/russell/g722-sillyness/codecs/codec_g722.c Thu Mar  6 17:25:18 2008
@@ -121,7 +121,7 @@
 	outlen = g722_encode(&tmp->g722, (uint8_t *) (&pvt->outbuf[pvt->datalen]), 
 		(int16_t *) f->data, f->samples);
 
-	pvt->samples += outlen;
+	pvt->samples += outlen * 2;
 
 	pvt->datalen += outlen;
 

Modified: team/russell/g722-sillyness/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/russell/g722-sillyness/main/rtp.c?view=diff&rev=106496&r1=106495&r2=106496
==============================================================================
--- team/russell/g722-sillyness/main/rtp.c (original)
+++ team/russell/g722-sillyness/main/rtp.c Thu Mar  6 17:25:18 2008
@@ -3186,8 +3186,14 @@
 			ast_smoother_feed(rtp->smoother, _f);
 		}
 
-		while ((f = ast_smoother_read(rtp->smoother)) && (f->data))
+		while ((f = ast_smoother_read(rtp->smoother)) && (f->data)) {
+			if (f->subclass == AST_FORMAT_G722) {
+				/* G.722 is silllllllllllllly */
+				f->samples /= 2;
+			}
+
 			ast_rtp_raw_write(rtp, f, codec);
+		}
 	} else {
 		/* Don't buffer outgoing frames; send them one-per-packet: */
 		if (_f->offset < hdrlen) 




More information about the asterisk-commits mailing list