[asterisk-commits] trunk r20225 - /trunk/app.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Apr 14 17:53:06 MST 2006


Author: rizzo
Date: Fri Apr 14 19:53:04 2006
New Revision: 20225

URL: http://svn.digium.com/view/asterisk?rev=20225&view=rev
Log:
applied two of the 3 chunks in #6907, and a similar one
(replace nested 'if' with '&&')
I cannot make sense of the first chunk of the proposed patch,
i think the original is correct.


Modified:
    trunk/app.c

Modified: trunk/app.c
URL: http://svn.digium.com/view/asterisk/trunk/app.c?rev=20225&r1=20224&r2=20225&view=diff
==============================================================================
--- trunk/app.c (original)
+++ trunk/app.c Fri Apr 14 19:53:04 2006
@@ -739,19 +739,13 @@
 	for (x=0;x<fmtcnt;x++) {
 		if (!others[x])
 			break;
-		if (res > 0) {
-			if (totalsilence)
-				ast_stream_rewind(others[x], totalsilence-200);
-			else
-				ast_stream_rewind(others[x], 200);
-		}
+		if (res > 0)
+			ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
 		ast_truncstream(others[x]);
 		ast_closestream(others[x]);
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
 	}
 	if (outmsg > 1) {
 		/* Let them know recording is stopped */
@@ -982,17 +976,13 @@
 			ast_filedelete(prependfile, sfmt[x]);
 		}
 	}
-	if (rfmt) {
-		if (ast_set_read_format(chan, rfmt)) {
-			ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
-		}
-	}
-	if (outmsg) {
-		if (outmsg > 1) {
-			/* Let them know it worked */
-			ast_streamfile(chan, "auth-thankyou", chan->language);
-			ast_waitstream(chan, "");
-		}
+	if (rfmt && ast_set_read_format(chan, rfmt)) {
+		ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
+	}
+	if (outmsg > 1) {
+		/* Let them know it worked */
+		ast_streamfile(chan, "auth-thankyou", chan->language);
+		ast_waitstream(chan, "");
 	}	
 	return res;
 }



More information about the asterisk-commits mailing list