From: Matthew Jordan Date: Wed, 2 May 2012 02:44:15 +0000 (+0000) Subject: Only log a failure to get read/write samples from factories if it didn't happen X-Git-Tag: 10.5.0-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e509421a70958fa36668b2e6d1a442134d20cf8;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@364965 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/audiohook.c b/main/audiohook.c index 83fec318fb..2ed9b27d1d 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) {