[Asterisk-cvs] asterisk/res res_adsi.c,1.5,1.6 res_musiconhold.c,1.22,1.23

markster at lists.digium.com markster at lists.digium.com
Sat Mar 27 01:52:45 CST 2004


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv1845/res

Modified Files:
	res_adsi.c res_musiconhold.c 
Log Message:
Make read/write mode have a lock parameter and use it properly.


Index: res_adsi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_adsi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- res_adsi.c	20 Nov 2003 10:32:53 -0000	1.5
+++ res_adsi.c	27 Mar 2004 06:50:12 -0000	1.6
@@ -367,15 +367,15 @@
 
 	ast_stopstream(chan);
 
-	if (ast_set_write_format(chan, AST_FORMAT_ULAW)) {
+	if (ast_set_write_format(chan, AST_FORMAT_ULAW, 1)) {
 		ast_log(LOG_WARNING, "Unable to set write format to ULAW\n");
 		return -1;
 	}
 
-	if (ast_set_read_format(chan, AST_FORMAT_ULAW)) {
+	if (ast_set_read_format(chan, AST_FORMAT_ULAW, 1)) {
 		ast_log(LOG_WARNING, "Unable to set read format to ULAW\n");
 		if (writeformat) {
-			if (ast_set_write_format(chan, writeformat)) 
+			if (ast_set_write_format(chan, writeformat, 1)) 
 				ast_log(LOG_WARNING, "Unable to restore write format to %d\n", writeformat);
 		}
 		return -1;
@@ -385,9 +385,9 @@
 		chan->adsicpe = (chan->adsicpe & ~ADSI_FLAG_DATAMODE) | newdatamode;
 
 	if (writeformat)
-		ast_set_write_format(chan, writeformat);
+		ast_set_write_format(chan, writeformat, 1);
 	if (readformat)
-		ast_set_read_format(chan, readformat);
+		ast_set_read_format(chan, readformat, 1);
 
 	return res;
 }

Index: res_musiconhold.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- res_musiconhold.c	24 Mar 2004 21:54:05 -0000	1.22
+++ res_musiconhold.c	27 Mar 2004 06:50:12 -0000	1.23
@@ -397,7 +397,7 @@
 	oldwfmt = moh->origwfmt;
 	free(moh);
 	if (chan) {
-		if (oldwfmt && ast_set_write_format(chan, oldwfmt)) 
+		if (oldwfmt && ast_set_write_format(chan, oldwfmt, 0)) 
 			ast_log(LOG_WARNING, "Unable to restore channel '%s' to format %s\n", chan->name, ast_getformatname(oldwfmt));
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Stopped music on hold on %s\n", chan->name);
@@ -420,7 +420,7 @@
 	ast_mutex_unlock(&moh_lock);
 	if (res) {
 		res->origwfmt = chan->writeformat;
-		if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
+		if (ast_set_write_format(chan, AST_FORMAT_SLINEAR, 1)) {
 			ast_log(LOG_WARNING, "Unable to set '%s' to signed linear format\n", chan->name);
 			moh_release(NULL, res);
 			res = NULL;




More information about the svn-commits mailing list