[Asterisk-cvs] asterisk/apps app_meetme.c,1.116,1.117

kpfleming kpfleming
Fri Oct 28 12:43:34 CDT 2005


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

Modified Files:
	app_meetme.c 
Log Message:
use API call for frame volume adjustment


Index: app_meetme.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_meetme.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- app_meetme.c	26 Oct 2005 19:48:14 -0000	1.116
+++ app_meetme.c	28 Oct 2005 16:36:10 -0000	1.117
@@ -384,20 +384,6 @@
 	ast_channel_setoption(user->chan, AST_OPTION_RXGAIN, &zero_volume, sizeof(zero_volume), 0);
 }
 
-static void adjust_volume(struct ast_frame *f, int vol)
-{
-	int count;
-	short *fdata = f->data;
-
-	for (count = 0; count < (f->datalen / sizeof(*fdata)); count++) {
-		if (vol > 0) {
-			fdata[count] *= abs(vol);
-		} else if (vol < 0) {
-			fdata[count] /= abs(vol);
-		}
-	}
-}
-
 static void conf_play(struct ast_channel *chan, struct ast_conference *conf, int sound)
 {
 	unsigned char *data;
@@ -1239,9 +1225,9 @@
 				if (!f)
 					break;
 				if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
-					if (user->talk.actual) {
-						adjust_volume(f, user->talk.actual);
-					}
+					if (user->talk.actual)
+						ast_frame_adjust_volume(f, user->talk.actual);
+
 					if (confflags &  CONFFLAG_MONITORTALKER) {
 						int totalsilence;
 						if (user->talking == -1)
@@ -1476,7 +1462,7 @@
 					fr.data = buf;
 					fr.offset = AST_FRIENDLY_OFFSET;
 					if (user->listen.actual)
-						adjust_volume(&fr, user->listen.actual);
+						ast_frame_adjust_volume(&fr, user->listen.actual);
 					if (ast_write(chan, &fr) < 0) {
 						ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
 						/* break; */




More information about the svn-commits mailing list