summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-05-02 02:51:02 +0000
committerMatthew Jordan <mjordan@digium.com>2012-05-02 02:51:02 +0000
commit54143892aff3d7fbc5b413b947a227a291fdcb86 (patch)
treefbdbeb9550f7bb1c577577ec89f6648e9014be06
parent355a6d6f37a7b8d0618ccf580fe5edc146e8ca77 (diff)
Only log a failure to get read/write samples from factories if it didn't happen
In audiohook_read_frame_both, anytime samples are obtained from the read/write factories a debug statement is logged stating that samples were not obtained from the factories. This statement used to only occur if option_debug was turned on and no samples were obtained; in some refactoring when the option_debug statement was removed, the "else" clause was removed as well. This patch makes it so that those debug log statements only occur if the condition leading up to them actually happened. ........ Merged revisions 364965 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--main/audiohook.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/audiohook.c b/main/audiohook.c
index 64c95f0de..e7a84919b 100644
--- a/main/audiohook.c
+++ b/main/audiohook.c
@@ -288,8 +288,9 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
}
}
}
+ } else {
+ ast_debug(1, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory);
}
- ast_debug(1, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory);
/* Move on to the write factory... if there are enough samples, read them in */
if (usable_write) {
@@ -307,8 +308,9 @@ static struct ast_frame *audiohook_read_frame_both(struct ast_audiohook *audioho
}
}
}
+ } else {
+ ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
}
- ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
/* Basically we figure out which buffer to use... and if mixing can be done here */
if (read_buf && read_reference) {