--- channel.orig 2006-11-15 08:28:29.000000000 -0600 +++ channel.c 2006-11-15 08:30:49.000000000 -0600 @@ -2192,9 +2192,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 @@ -2611,9 +2612,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