From dd601f4f384f5c0ddd5715012a1254f83c55604b Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Sat, 28 Apr 2007 21:54:44 +0000
Subject: [PATCH] Enable the functionality of the 'o' option to "optimize
 talker" by default.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 apps/app_meetme.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/apps/app_meetme.c b/apps/app_meetme.c
index c4d516829f..5cdb85409b 100644
--- a/apps/app_meetme.c
+++ b/apps/app_meetme.c
@@ -145,8 +145,6 @@ enum {
 	CONFFLAG_EMPTY = (1 << 18),
 	CONFFLAG_EMPTYNOPIN = (1 << 19),
 	CONFFLAG_ALWAYSPROMPT = (1 << 20),
-	/*! If set, treats talking users as muted users */
-	CONFFLAG_OPTIMIZETALKER = (1 << 21),
 	/*! If set, won't speak the extra prompt when the first person 
 	 *  enters the conference */
 	CONFFLAG_NOONLYPERSON = (1 << 22),
@@ -183,7 +181,6 @@ AST_APP_OPTIONS(meetme_opts, BEGIN_OPTIONS
 	AST_APP_OPTION('I', CONFFLAG_INTROUSERNOREVIEW ),
 	AST_APP_OPTION('M', CONFFLAG_MOH ),
 	AST_APP_OPTION('m', CONFFLAG_STARTMUTED ),
-	AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
 	AST_APP_OPTION('P', CONFFLAG_ALWAYSPROMPT ),
 	AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
 	AST_APP_OPTION('q', CONFFLAG_QUIET ),
@@ -1694,7 +1691,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
 			x = 1;
 			ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
 		}	
-		if (confflags & (CONFFLAG_MONITORTALKER | CONFFLAG_OPTIMIZETALKER) && !(dsp = ast_dsp_new())) {
+		if (!(dsp = ast_dsp_new())) {
 			ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
 			res = -1;
 		}
@@ -1893,7 +1890,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
 					if (user->talk.actual)
 						ast_frame_adjust_volume(f, user->talk.actual);
 
-					if (confflags & (CONFFLAG_MONITORTALKER | CONFFLAG_OPTIMIZETALKER)) {
+					{
 						int totalsilence;
 
 						if (user->talking == -1)
@@ -1936,7 +1933,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
 						   don't want to block, but we do want to at least *try*
 						   to write out all the samples.
 						 */
-						if (user->talking || !(confflags & CONFFLAG_OPTIMIZETALKER))
+						if (user->talking)
 							careful_write(fd, f->data, f->datalen, 0);
 					}
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
@@ -2138,11 +2135,10 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
 					fr.samples = res/2;
 					fr.data = buf;
 					fr.offset = AST_FRIENDLY_OFFSET;
-					if (!user->listen.actual && 
+					if ( !user->listen.actual && 
 						((confflags & CONFFLAG_MONITOR) || 
 						 (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) ||
-						 (!user->talking && (confflags & CONFFLAG_OPTIMIZETALKER))
-						 )) {
+						 (!user->talking)) ) {
 						int index;
 						for (index=0;index<AST_FRAME_BITS;index++)
 							if (chan->rawwriteformat & (1 << index))
-- 
GitLab