[asterisk-commits] mjordan: trunk r364966 - in /trunk: ./ main/audiohook.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 1 21:51:06 CDT 2012


Author: mjordan
Date: Tue May  1 21:51:02 2012
New Revision: 364966

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=364966
Log:
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

Modified:
    trunk/   (props changed)
    trunk/main/audiohook.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/audiohook.c?view=diff&rev=364966&r1=364965&r2=364966
==============================================================================
--- trunk/main/audiohook.c (original)
+++ trunk/main/audiohook.c Tue May  1 21:51:02 2012
@@ -288,8 +288,9 @@
 				}
 			}
 		}
-	}
-	ast_debug(1, "Failed to get %d samples from read factory %p\n", (int)samples, &audiohook->read_factory);
+	} else {
+		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 @@
 				}
 			}
 		}
-	}
-	ast_debug(1, "Failed to get %d samples from write factory %p\n", (int)samples, &audiohook->write_factory);
+	} else {
+		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) {




More information about the asterisk-commits mailing list