[asterisk-commits] trunk r31776 - in /trunk: ./ res/res_musiconhold.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jun 3 10:04:52 MST 2006


Author: russell
Date: Sat Jun  3 12:04:51 2006
New Revision: 31776

URL: http://svn.digium.com/view/asterisk?rev=31776&view=rev
Log:
when using moh files mode, don't look for a file past the number of files
that have been loaded, or worse, past the size of the files array

Modified:
    trunk/   (props changed)
    trunk/res/res_musiconhold.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Modified: trunk/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_musiconhold.c?rev=31776&r1=31775&r2=31776&view=diff
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Sat Jun  3 12:04:51 2006
@@ -217,6 +217,8 @@
 
 			if (ast_test_flag(state->class, MOH_RANDOMIZE))
 				state->pos = ast_random();
+
+			state->pos %= state->class->total_files;
 
 			/* check to see if this file's format can be opened */
 			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) != -1)



More information about the asterisk-commits mailing list