git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4459 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-03-06 04:59:20 +00:00
parent 91004a8a2e
commit 29eabfe73d
1 changed files with 30 additions and 23 deletions

View File

@ -1365,13 +1365,8 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, v
}
}
if (switch_test_flag(member, MFLAG_WASTE_BANDWIDTH) && !talking) {
memset(read_frame->data, 255, read_frame->datalen);
}
/* skip frames that are not actual media or when we are muted or silent */
if ((talking || energy_level == 0) && switch_test_flag(member, MFLAG_CAN_SPEAK) || switch_test_flag(member, MFLAG_WASTE_BANDWIDTH)) {
if ((talking || energy_level == 0) && switch_test_flag(member, MFLAG_CAN_SPEAK)) {
if (member->read_resampler) {
int16_t *bptr = (int16_t *) read_frame->data;
int len = (int) read_frame->datalen;;
@ -1644,6 +1639,7 @@ static void conference_loop_output(conference_member_t *member)
switch_buffer_t *use_buffer = NULL;
uint32_t mux_used = (uint32_t)switch_buffer_inuse(member->mux_buffer) >= bytes ? 1 : 0;
if (mux_used) {
while (mux_used) {
/* Flush the output buffer and write all the data (presumably muxed) back to the channel */
switch_mutex_lock(member->audio_out_mutex);
@ -1668,7 +1664,18 @@ static void conference_loop_output(conference_member_t *member)
if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
break;
}
}
} else {
if (switch_test_flag(member, MFLAG_WASTE_BANDWIDTH)) {
memset(write_frame.data, 255, bytes);
write_frame.datalen = bytes;
write_frame.samples = samples;
write_frame.timestamp = timer.samplecount;
switch_core_session_write_frame(member->session, &write_frame, -1, 0);
}
if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
break;
}
}
}
} /* Rinse ... Repeat */