[Asterisk-cvs] asterisk rtp.c,1.90,1.91

markster at lists.digium.com markster at lists.digium.com
Wed Sep 15 14:38:39 CDT 2004


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv27812

Modified Files:
	rtp.c 
Log Message:
First pass at LPC10


Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- rtp.c	9 Sep 2004 02:33:14 -0000	1.90
+++ rtp.c	15 Sep 2004 18:40:07 -0000	1.91
@@ -549,8 +549,12 @@
 			rtp->f.samples = g723_samples(rtp->f.data, rtp->f.datalen);
 			break;
 		case AST_FORMAT_SPEEX:
-		        rtp->f.samples = 160;
 			/* assumes that the RTP packet contained one Speex frame */
+	        rtp->f.samples = 160;
+			break;
+		case AST_FORMAT_LPC10:
+		    rtp->f.samples = 22 * 8;
+			rtp->f.samples += (((char *)(f->data))[7] & 0x1) * 8;
 			break;
 		default:
 			ast_log(LOG_NOTICE, "Unable to calculate samples for format %s\n", ast_getformatname(rtp->f.subclass));
@@ -1082,6 +1086,11 @@
 		    pred = rtp->lastts + 160;
 			/* assumes that the RTP packet contains one Speex frame */
 			break;
+		case AST_FORMAT_LPC10:
+			/* assumes that the RTP packet contains one LPC10 frame */
+		    pred = rtp->lastts + 22 * 8;
+			pred += (((char *)(f->data))[7] & 0x1) * 8;
+			break;
 		default:
 			ast_log(LOG_WARNING, "Not sure about timestamp format for codec format %s\n", ast_getformatname(f->subclass));
 		}
@@ -1245,6 +1254,7 @@
 	case AST_FORMAT_H261:
 	case AST_FORMAT_H263:
 	case AST_FORMAT_G723_1:
+	case AST_FORMAT_LPC10:
 	case AST_FORMAT_SPEEX:
 	        /* Don't buffer outgoing frames; send them one-per-packet: */
 		if (_f->offset < hdrlen) {




More information about the svn-commits mailing list