[asterisk-commits] may: branch may/chan_ooh323_evo r365132 - in /team/may/chan_ooh323_evo: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 3 05:52:19 CDT 2012


Author: may
Date: Thu May  3 05:52:14 2012
New Revision: 365132

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

Merged revisions 364966 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/may/chan_ooh323_evo/   (props changed)
    team/may/chan_ooh323_evo/main/audiohook.c

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  3 05:52:14 2012
@@ -1,1 +1,1 @@
-/trunk:356965-357014
+/trunk:356965-357014,364966

Propchange: team/may/chan_ooh323_evo/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May  3 05:52:14 2012
@@ -1,1 +1,1 @@
-/trunk:1-364918
+/trunk:1-364918,364966

Modified: team/may/chan_ooh323_evo/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/team/may/chan_ooh323_evo/main/audiohook.c?view=diff&rev=365132&r1=365131&r2=365132
==============================================================================
--- team/may/chan_ooh323_evo/main/audiohook.c (original)
+++ team/may/chan_ooh323_evo/main/audiohook.c Thu May  3 05:52:14 2012
@@ -173,16 +173,13 @@
 	other_factory_ms = other_factory_samples / (audiohook->hook_internal_samp_rate / 1000);
 
 	if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && other_factory_samples && (our_factory_ms - other_factory_ms > AST_AUDIOHOOK_SYNC_TOLERANCE)) {
-		if (option_debug)
-			ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook);
+		ast_debug(1, "Flushing audiohook %p so it remains in sync\n", audiohook);
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
 	}
 
 	if (ast_test_flag(audiohook, AST_AUDIOHOOK_SMALL_QUEUE) && ((our_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE) || (other_factory_ms > AST_AUDIOHOOK_SMALL_QUEUE_TOLERANCE))) {
-		if (option_debug) {
-			ast_log(LOG_DEBUG, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
-		}
+		ast_debug(1, "Audiohook %p has stale audio in its factories. Flushing them both\n", audiohook);
 		ast_slinfactory_flush(factory);
 		ast_slinfactory_flush(other_factory);
 	}
@@ -291,8 +288,9 @@
 				}
 			}
 		}
-	} else if (option_debug)
-		ast_log(LOG_DEBUG, "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) {
@@ -310,8 +308,9 @@
 				}
 			}
 		}
-	} else if (option_debug)
-		ast_log(LOG_DEBUG, "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) {
@@ -970,7 +969,7 @@
 			}
 			break;
 		default:
-			ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type);
+			ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
 			return -1;
 	}
 
@@ -1005,7 +1004,7 @@
 			}
 			break;
 		default:
-			ast_log(LOG_DEBUG, "Invalid audiohook type supplied, (%d)\n", type);
+			ast_debug(1, "Invalid audiohook type supplied, (%d)\n", type);
 			return -1;
 	}
 	return count;




More information about the asterisk-commits mailing list