mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 03:48:02 +00:00
properly reindent a block
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
65
channel.c
65
channel.c
@@ -2346,45 +2346,44 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
||||
if (chan->tech->write == NULL)
|
||||
break;
|
||||
|
||||
/* XXX need to reindent this block */
|
||||
/* Bypass translator if we're writing format in the raw write format. This
|
||||
allows mixing of native / non-native formats */
|
||||
if (fr->subclass == chan->rawwriteformat)
|
||||
f = fr;
|
||||
else
|
||||
f = (chan->writetrans) ? ast_translate(chan->writetrans, fr, 0) : fr;
|
||||
if (f == NULL) {
|
||||
res = 0;
|
||||
} else {
|
||||
if (chan->spies)
|
||||
queue_frame_to_spies(chan, f, SPY_WRITE);
|
||||
/* Bypass translator if we're writing format in the raw write format. This
|
||||
allows mixing of native / non-native formats */
|
||||
if (fr->subclass == chan->rawwriteformat)
|
||||
f = fr;
|
||||
else
|
||||
f = (chan->writetrans) ? ast_translate(chan->writetrans, fr, 0) : fr;
|
||||
if (f == NULL) {
|
||||
res = 0;
|
||||
} else {
|
||||
if (chan->spies)
|
||||
queue_frame_to_spies(chan, f, SPY_WRITE);
|
||||
|
||||
if (chan->monitor && chan->monitor->write_stream) {
|
||||
if (chan->monitor && chan->monitor->write_stream) {
|
||||
#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)
|
||||
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;
|
||||
} else
|
||||
chan->outsmpl += 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 + 4 * f->samples;
|
||||
} else
|
||||
chan->outsmpl += f->samples;
|
||||
#else
|
||||
int jump = chan->insmpl - chan->outsmpl;
|
||||
if (jump - MONITOR_DELAY >= 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;
|
||||
} else
|
||||
chan->outsmpl += f->samples;
|
||||
int jump = chan->insmpl - chan->outsmpl;
|
||||
if (jump - MONITOR_DELAY >= 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;
|
||||
} else
|
||||
chan->outsmpl += f->samples;
|
||||
#endif
|
||||
if (chan->monitor->state == AST_MONITOR_RUNNING) {
|
||||
if (ast_writestream(chan->monitor->write_stream, f) < 0)
|
||||
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
|
||||
}
|
||||
if (chan->monitor->state == AST_MONITOR_RUNNING) {
|
||||
if (ast_writestream(chan->monitor->write_stream, f) < 0)
|
||||
ast_log(LOG_WARNING, "Failed to write data to channel monitor write stream\n");
|
||||
}
|
||||
|
||||
res = chan->tech->write(chan, f);
|
||||
}
|
||||
|
||||
res = chan->tech->write(chan, f);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user