[asterisk-commits] russell: branch 1.4 r51848 - in /branches/1.4: ./ main/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 23 17:59:59 MST 2007


Author: russell
Date: Tue Jan 23 18:59:58 2007
New Revision: 51848

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51848
Log:
Merged revisions 51843 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r51843 | russell | 2007-01-23 18:57:28 -0600 (Tue, 23 Jan 2007) | 6 lines

Fix an issue related to synchronization of recordings when using Monitor().
The bug is a miscalculation of the amount to seek the stream for writing to
disk when the number of samples coming in and out of a channel do not match up.
(issue #8298, #8887, report and patch by guillecabeza, patch files created and
 testing done by whoiswes)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/main/channel.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=51848&r1=51847&r2=51848
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Tue Jan 23 18:59:58 2007
@@ -2290,9 +2290,10 @@
 #ifndef MONITOR_CONSTANT_DELAY
 					int jump = chan->outsmpl - chan->insmpl - 4 * f->samples;
 					if (jump >= 0) {
-						if (ast_seekstream(chan->monitor->read_stream, jump + f->samples, SEEK_FORCECUR) == -1)
+						jump = chan->outsmpl - chan->insmpl;
+						if (ast_seekstream(chan->monitor->read_stream, jump, SEEK_FORCECUR) == -1)
 							ast_log(LOG_WARNING, "Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
-						chan->insmpl += jump + 4 * f->samples;
+						chan->insmpl += jump + f->samples;
 					} else
 						chan->insmpl+= f->samples;
 #else
@@ -2710,9 +2711,10 @@
 #ifndef MONITOR_CONSTANT_DELAY
 			int jump = chan->insmpl - chan->outsmpl - 4 * f->samples;
 			if (jump >= 0) {
-				if (ast_seekstream(chan->monitor->write_stream, jump + f->samples, SEEK_FORCECUR) == -1)
+				jump = chan->insmpl - chan->outsmpl;
+				if (ast_seekstream(chan->monitor->write_stream, jump, SEEK_FORCECUR) == -1)
 					ast_log(LOG_WARNING, "Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
-				chan->outsmpl += jump + 4 * f->samples;
+				chan->outsmpl += jump + f->samples;
 			} else
 				chan->outsmpl += f->samples;
 #else



More information about the asterisk-commits mailing list