[svn-commits] dlee: branch dlee/record-controls r395354 - /team/dlee/record-controls/main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jul 24 19:55:14 CDT 2013


Author: dlee
Date: Wed Jul 24 19:55:12 2013
New Revision: 395354

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395354
Log:
Reverted 'running' flag back to the original for(;;) loop

Modified:
    team/dlee/record-controls/main/app.c

Modified: team/dlee/record-controls/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/record-controls/main/app.c?view=diff&rev=395354&r1=395353&r2=395354
==============================================================================
--- team/dlee/record-controls/main/app.c (original)
+++ team/dlee/record-controls/main/app.c Wed Jul 24 19:55:12 2013
@@ -1145,11 +1145,11 @@
 }
 
 /*!
- * \brief Construct a silence frame of the same duration of \a orig.
+ * \brief Construct a silence frame of the same duration as \a orig.
  *
  * The \a orig frame must be \ref AST_FORMAT_SLINEAR.
  *
- * \param orig Frame to base silence.
+ * \param orig Frame as basis for silence to generate.
  * \return New frame of silence; free with ast_frfree().
  * \return \c NULL on error.
  */
@@ -1368,12 +1368,11 @@
 		struct ast_frame *f;
 		int paused = 0;
 		int muted = 0;
-		int running = 1;
 		time_t pause_start = 0;
 		int paused_secs = 0;
 		int pausedsilence = 0;
 
-		while (running) {
+		for (;;) {
 			if (!(res = ast_waitfor(chan, 2000))) {
 				ast_debug(1, "One waitfor failed, trying another\n");
 				/* Try one more time in case of masq */
@@ -1402,6 +1401,8 @@
 					if (muted) {
 						silence = make_silence(orig);
 						if (!silence) {
+							ast_log(LOG_WARNING,
+								"Error creating silence\n");
 							break;
 						}
 						f = silence;
@@ -1431,7 +1432,7 @@
 						/* ignore the paused silence */
 						dspsilence -= pausedsilence;
 					} else {
-						/* we're not paused, and dspsilence is less than paused silence. reset pausedsilence */
+						/* dspsilence has reset, reset pausedsilence */
 						pausedsilence = 0;
 					}
 
@@ -1474,13 +1475,11 @@
 			} else if (f->frametype == AST_FRAME_CONTROL) {
 				if (f->subclass.integer == AST_CONTROL_RECORD_CANCEL) {
 					ast_verb(3, "Message canceled by control\n");
-					running = 0;
 					outmsg = 0; /* cancels the recording */
 					res = 0;
 					break;
 				} else if (f->subclass.integer == AST_CONTROL_RECORD_STOP) {
 					ast_verb(3, "Message ended by control\n");
-					running = 0;
 					res = 0;
 					break;
 				} else if (f->subclass.integer == AST_CONTROL_RECORD_SUSPEND) {
@@ -1505,7 +1504,7 @@
 						res = set_read_to_slin(chan, &rfmt);
 						if (res < 0) {
 							ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n");
-							running = 0;
+							break;
 						}
 					}
 				}




More information about the svn-commits mailing list