diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-16 14:14:16 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-04-16 14:14:16 +0000 |
commit | 10632ecc83281062a4dad3928869087ba2c72435 (patch) | |
tree | 6e2c49a1249c73a8849f1af4fb73c6f054b2b42a | |
parent | 752f273b24ea0206b1ff74d0cd786b1c4df39813 (diff) |
properly reindent a block
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20484 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channel.c | 65 |
1 files changed, 32 insertions, 33 deletions
@@ -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; } |