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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 27 11:16:56 CDT 2007


Author: russell
Date: Mon Aug 27 11:16:56 2007
New Revision: 81043

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81043
Log:
Merged revisions 81042 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81042 | russell | 2007-08-27 11:16:25 -0500 (Mon, 27 Aug 2007) | 11 lines

(closes issue #10419)
Reported by: mustardman
Patches:
      asterisk-mohposition.diff.txt uploaded by jamesgolovich (license 176)

This patch fixes a few problems with music on hold.
 * Fix issues with starting at the beginning of a file when it shouldn't.
 * Fix the inuse counter to be decremented even if the class had not been
   set to be deleted when not in use anymore
 * Don't arbitrarily limit the number of MOH files to 255

........

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

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

Modified: trunk/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=81043&r1=81042&r2=81043
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Mon Aug 27 11:16:56 2007
@@ -117,8 +117,8 @@
 	int origwfmt;
 	int samples;
 	int sample_queue;
-	unsigned char pos;
-	unsigned char save_pos;
+	int pos;
+	int save_pos;
 };
 
 #define MOH_QUIET		(1 << 0)
@@ -214,7 +214,7 @@
 		}
 		state->save_pos = state->pos;
 	}
-	if (state->class->delete && ast_atomic_dec_and_test(&state->class->inuse))
+	if (ast_atomic_dec_and_test(&state->class->inuse) && state->class->delete)
 		ast_moh_destroy_one(state->class);
 }
 
@@ -231,9 +231,9 @@
 	}
 
 	/* If a specific file has been saved, use it */
-	if (state->save_pos) {
+	if (state->save_pos >= 0) {
 		state->pos = state->save_pos;
-		state->save_pos = 0;
+		state->save_pos = -1;
 	} else if (ast_test_flag(state->class, MOH_RANDOMIZE)) {
 		/* Get a random file and ensure we can open it */
 		for (tries = 0; tries < 20; tries++) {




More information about the asterisk-commits mailing list