[svn-commits] tilghman: branch 1.6.0 r179470 - in /branches/1.6.0: ./ main/app.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 2 17:11:28 CST 2009


Author: tilghman
Date: Mon Mar  2 17:11:24 2009
New Revision: 179470

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=179470
Log:
Merged revisions 179469 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r179469 | tilghman | 2009-03-02 17:10:18 -0600 (Mon, 02 Mar 2009) | 17 lines
  
  Merged revisions 179468 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r179468 | tilghman | 2009-03-02 17:09:01 -0600 (Mon, 02 Mar 2009) | 10 lines
    
    When ending a recording with silence detection, remember to reduce the duration.
    The end of the recording is correspondingly trimmed, but the duration was not
    trimmed by the number of seconds trimmed, so the saved duration was necessarily
    longer than the actual soundfile duration.
    (closes issue #14406)
     Reported by: sasargen
     Patches: 
           20090226__bug14406.diff.txt uploaded by tilghman (license 14)
     Tested by: sasargen
  ........
................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/main/app.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/main/app.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.6.0/main/app.c?view=diff&rev=179470&r1=179469&r2=179470
==============================================================================
--- branches/1.6.0/main/app.c (original)
+++ branches/1.6.0/main/app.c Mon Mar  2 17:11:24 2009
@@ -785,8 +785,16 @@
 			 * off the recording.  However, if we ended with '#', we don't want
 			 * to trim ANY part of the recording.
 			 */
-			if (res > 0 && totalsilence)
+			if (res > 0 && totalsilence) {
 				ast_stream_rewind(others[x], totalsilence - 200);
+				/* Reduce duration by a corresponding amount */
+				if (x == 0 && *duration) {
+					*duration -= (totalsilence - 200) / 1000;
+					if (*duration < 0) {
+						*duration = 0;
+					}
+				}
+			}
 			ast_truncstream(others[x]);
 			ast_closestream(others[x]);
 		}




More information about the svn-commits mailing list