[asterisk-commits] file: trunk r174219 - in /trunk: ./ res/res_musiconhold.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Feb 9 08:49:24 CST 2009
Author: file
Date: Mon Feb 9 08:49:24 2009
New Revision: 174219
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=174219
Log:
Merged revisions 174218 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r174218 | file | 2009-02-09 10:48:21 -0400 (Mon, 09 Feb 2009) | 4 lines
Don't overwrite our pointer to the music class when music on hold stops. We will use this if it starts again to see if we can resume the music where it left off.
(closes issue #14407)
Reported by: mostyn
........
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/svn-view/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=174219&r1=174218&r2=174219
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Mon Feb 9 08:49:24 2009
@@ -214,7 +214,7 @@
state->save_pos = state->pos;
- state->class = mohclass_unref(state->class);
+ mohclass_unref(state->class);
}
static int ast_moh_files_next(struct ast_channel *chan)
@@ -315,8 +315,6 @@
if (!chan->music_state && (state = ast_calloc(1, sizeof(*state)))) {
chan->music_state = state;
- state->class = mohclass_ref(class);
- state->save_pos = -1;
} else {
state = chan->music_state;
}
@@ -326,17 +324,13 @@
}
if (state->class != class) {
- /* (re-)initialize */
- if (state->class) {
- state->class = mohclass_unref(state->class);
- }
memset(state, 0, sizeof(*state));
- state->class = mohclass_ref(class);
- if (ast_test_flag(state->class, MOH_RANDOMIZE) && class->total_files) {
+ if (ast_test_flag(class, MOH_RANDOMIZE) && class->total_files) {
state->pos = ast_random() % class->total_files;
}
}
+ state->class = mohclass_ref(class);
state->origwfmt = chan->writeformat;
ast_verb(3, "Started music on hold, class '%s', on %s\n", class->name, chan->name);
More information about the asterisk-commits
mailing list