aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-04 23:02:38 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-04 23:02:38 +0000
commit4743c907e782f72e05ee7aee11451c35b35ff563 (patch)
tree0da4fc2eb087dba8921f91e885810d75ddeed839 /channel.c
parentb93e7e44931bd943b092ac3d111d2cfa0cdbc24a (diff)
make monitoring more tolerant of peers that deliver frames in bursts
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7799 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/channel.c b/channel.c
index ca7a6b388..dd1ca044c 100644
--- a/channel.c
+++ b/channel.c
@@ -1912,11 +1912,11 @@ struct ast_frame *ast_read(struct ast_channel *chan)
if (chan->monitor && chan->monitor->read_stream ) {
#ifndef MONITOR_CONSTANT_DELAY
- int jump = chan->outsmpl - chan->insmpl - 2 * f->samples;
+ 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)
ast_log(LOG_WARNING, "Failed to perform seek in monitoring read stream, synchronization between the files may be broken\n");
- chan->insmpl += jump + 2 * f->samples;
+ chan->insmpl += jump + 4 * f->samples;
} else
chan->insmpl+= f->samples;
#else
@@ -2258,11 +2258,11 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
if( chan->monitor && chan->monitor->write_stream &&
f && ( f->frametype == AST_FRAME_VOICE ) ) {
#ifndef MONITOR_CONSTANT_DELAY
- int jump = chan->insmpl - chan->outsmpl - 2 * f->samples;
+ 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)
ast_log(LOG_WARNING, "Failed to perform seek in monitoring write stream, synchronization between the files may be broken\n");
- chan->outsmpl += jump + 2 * f->samples;
+ chan->outsmpl += jump + 4 * f->samples;
} else
chan->outsmpl += f->samples;
#else