[Freeswitch-svn] [commit] r7458 - freeswitch/trunk/src/mod/applications/mod_conference

Freeswitch SVN anthm at freeswitch.org
Fri Feb 1 10:17:39 EST 2008


Author: anthm
Date: Fri Feb  1 10:17:38 2008
New Revision: 7458

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c

Log:
tweak

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Fri Feb  1 10:17:38 2008
@@ -871,11 +871,14 @@
 			int nt = 0;
 			/* Build a muxed frame for every member that contains the mixed audio of everyone else */
 			for (omember = conference->members; omember; omember = omember->next) {
-				omember->read = bytes;
 				if (has_file_data && file_sample_len) {
-					memcpy(omember->mux_frame, file_frame, file_sample_len * 2);
-				} else {
-					memset(omember->mux_frame, 0, omember->read);
+                    uint32_t sample_bytes = file_sample_len * 2;
+					memcpy(omember->mux_frame, file_frame, sample_bytes);
+                    if (sample_bytes < bytes) {
+                        memset(omember->mux_frame + sample_bytes, 255, bytes - sample_bytes);
+                    }
+                } else {
+					memset(omember->mux_frame, 255, bytes);
 				}
 				for (imember = conference->members; imember; imember = imember->next) {
 					uint32_t x;
@@ -937,7 +940,7 @@
 			for (imember = conference->members; imember; imember = imember->next) {
 				if (switch_test_flag(imember, MFLAG_RUNNING)) {
 					switch_mutex_lock(imember->audio_out_mutex);
-					switch_buffer_write(imember->mux_buffer, imember->mux_frame, imember->read);
+					switch_buffer_write(imember->mux_buffer, imember->mux_frame, bytes);
 					switch_mutex_unlock(imember->audio_out_mutex);
 				}
 			}



More information about the Freeswitch-svn mailing list