aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 00:53:04 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-15 00:53:04 +0000
commit91102c5a2cae50a81cc3e135cad4d297aa5d71d6 (patch)
tree598a048459bebd809ff162bfededf0294d6c3a0b /app.c
parentdca83005a59655db2a4a4753779c9c43c216409e (diff)
applied two of the 3 chunks in #6907, and a similar one
(replace nested 'if' with '&&') I cannot make sense of the first chunk of the proposed patch, i think the original is correct. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20225 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'app.c')
-rw-r--r--app.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/app.c b/app.c
index bdd76ce84..34209a164 100644
--- a/app.c
+++ b/app.c
@@ -739,19 +739,13 @@ int ast_play_and_record(struct ast_channel *chan, const char *playfile, const ch
for (x=0;x<fmtcnt;x++) {
if (!others[x])
break;
- if (res > 0) {
- if (totalsilence)
- ast_stream_rewind(others[x], totalsilence-200);
- else
- ast_stream_rewind(others[x], 200);
- }
+ if (res > 0)
+ ast_stream_rewind(others[x], totalsilence ? totalsilence-200 : 200);
ast_truncstream(others[x]);
ast_closestream(others[x]);
}
- if (rfmt) {
- if (ast_set_read_format(chan, rfmt)) {
- ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
- }
+ if (rfmt && ast_set_read_format(chan, rfmt)) {
+ ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
}
if (outmsg > 1) {
/* Let them know recording is stopped */
@@ -982,17 +976,13 @@ int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordf
ast_filedelete(prependfile, sfmt[x]);
}
}
- if (rfmt) {
- if (ast_set_read_format(chan, rfmt)) {
- ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
- }
+ if (rfmt && ast_set_read_format(chan, rfmt)) {
+ ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
}
- if (outmsg) {
- if (outmsg > 1) {
- /* Let them know it worked */
- ast_streamfile(chan, "auth-thankyou", chan->language);
- ast_waitstream(chan, "");
- }
+ if (outmsg > 1) {
+ /* Let them know it worked */
+ ast_streamfile(chan, "auth-thankyou", chan->language);
+ ast_waitstream(chan, "");
}
return res;
}