[asterisk-commits] tilghman: branch 1.4 r89275 - /branches/1.4/main/app.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Nov 14 17:23:59 CST 2007
Author: tilghman
Date: Wed Nov 14 17:23:58 2007
New Revision: 89275
URL: http://svn.digium.com/view/asterisk?view=rev&rev=89275
Log:
When a recording ends with '#', we are improperly trimming an extra 200ms from the recording.
Reported by: sim
Patch by: tilghman
Closes issue #11247
Modified:
branches/1.4/main/app.c
Modified: branches/1.4/main/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/app.c?view=diff&rev=89275&r1=89274&r2=89275
==============================================================================
--- branches/1.4/main/app.c (original)
+++ branches/1.4/main/app.c Wed Nov 14 17:23:58 2007
@@ -705,8 +705,13 @@
for (x = 0; x < fmtcnt; x++) {
if (!others[x])
break;
- if (res > 0)
- ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200);
+ /*!\note
+ * If we ended with silence, trim all but the first 200ms of silence
+ * off the recording. However, if we ended with '#', we don't want
+ * to trim ANY part of the recording.
+ */
+ if (res > 0 && totalsilence)
+ ast_stream_rewind(others[x], totalsilence - 200);
ast_truncstream(others[x]);
ast_closestream(others[x]);
}
@@ -721,7 +726,9 @@
realfiles[x] = ast_readfile(recordfile, sfmt[x], comment, O_RDONLY, 0, 0);
if (!others[x] || !realfiles[x])
break;
- ast_stream_rewind(others[x], totalsilence ? totalsilence - 200 : 200);
+ /*!\note Same logic as above. */
+ if (totalsilence)
+ ast_stream_rewind(others[x], totalsilence - 200);
ast_truncstream(others[x]);
/* add the original file too */
while ((fr = ast_readframe(realfiles[x]))) {
More information about the asterisk-commits
mailing list