[svn-commits] branch 1.2 r31555 - /branches/1.2/res/res_musiconhold.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Jun 1 14:46:51 MST 2006


Author: kpfleming
Date: Thu Jun  1 16:46:50 2006
New Revision: 31555

URL: http://svn.digium.com/view/asterisk?rev=31555&view=rev
Log:
remove pointless forcing of the channel into SLINEAR mode; the write format will be set later based on the file that is chosen to be played to the channel

Modified:
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?rev=31555&r1=31554&r2=31555&view=diff
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Thu Jun  1 16:46:50 2006
@@ -221,10 +221,6 @@
 
 	state->pos = state->pos % state->class->total_files;
 	
-	if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
-		ast_log(LOG_WARNING, "Unable to set '%s' to linear format (write)\n", chan->name);
-		return -1;
-	}
 	if (!ast_openstream_full(chan, state->class->filearray[state->pos], chan->language, 1)) {
 		ast_log(LOG_WARNING, "Unable to open file '%s': %s\n", state->class->filearray[state->pos], strerror(errno));
 		state->pos++;
@@ -299,14 +295,8 @@
 
 		state->origwfmt = chan->writeformat;
 
-		if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
-			ast_log(LOG_WARNING, "Unable to set '%s' to linear format (write)\n", chan->name);
-			free(chan->music_state);
-			chan->music_state = NULL;
-		} else {
-			if (option_verbose > 2)
-				ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on %s\n", class->name, chan->name);
-		}
+		if (option_verbose > 2)
+			ast_verbose(VERBOSE_PREFIX_3 "Started music on hold, class '%s', on %s\n", class->name, chan->name);
 	}
 	
 	return chan->music_state;



More information about the svn-commits mailing list