whitespace cleanup (tabs not spaces)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7450 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-02-01 04:13:18 +00:00
parent 760112916c
commit 9f18ca0762
1 changed files with 97 additions and 103 deletions

View File

@ -768,7 +768,6 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
total++; total++;
imember->read = 0; imember->read = 0;
//memset(imember->frame, 255, bytes);
switch_clear_flag_locked(imember, MFLAG_HAS_AUDIO); switch_clear_flag_locked(imember, MFLAG_HAS_AUDIO);
switch_mutex_lock(imember->audio_in_mutex); switch_mutex_lock(imember->audio_in_mutex);
@ -778,19 +777,19 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
if ((buf_read = (uint32_t) switch_buffer_read(imember->audio_buffer, imember->frame, buf_read_max))) { if ((buf_read = (uint32_t) switch_buffer_read(imember->audio_buffer, imember->frame, buf_read_max))) {
/* If the caller is not at the right sample rate resample him to suit and buffer accordingly */ /* If the caller is not at the right sample rate resample him to suit and buffer accordingly */
if (imember->mux_resampler) { switch_audio_resampler_t *mux_resampler = imember->mux_resampler;
if (mux_resampler) {
int16_t *bptr = (int16_t *) imember->frame; int16_t *bptr = (int16_t *) imember->frame;
switch_assert(buf_read <= imember->mux_resampler->from_size); switch_assert(buf_read <= mux_resampler->from_size);
imember->mux_resampler->from_len = switch_short_to_float(bptr, imember->mux_resampler->from, (int) buf_read / 2); mux_resampler->from_len = switch_short_to_float(bptr, mux_resampler->from, (int) buf_read / 2);
imember->mux_resampler->to_len = switch_resample_process(imember->mux_resampler, mux_resampler->to_len = switch_resample_process(mux_resampler,
imember->mux_resampler->from, mux_resampler->from,
imember->mux_resampler->from_len, mux_resampler->from_len,
imember->mux_resampler->to, mux_resampler->to,
imember->mux_resampler->to_size, 0); mux_resampler->to_size, 0);
switch_float_to_short(mux_resampler->to, imember->resample_out, mux_resampler->to_len);
switch_float_to_short(imember->mux_resampler->to, imember->resample_out, imember->mux_resampler->to_len); switch_buffer_write(imember->resample_buffer, imember->resample_out, mux_resampler->to_len * 2);
switch_buffer_write(imember->resample_buffer, imember->resample_out, imember->mux_resampler->to_len * 2);
if (switch_buffer_inuse(imember->resample_buffer) >= bytes) { if (switch_buffer_inuse(imember->resample_buffer) >= bytes) {
if ((imember->read = (uint32_t) switch_buffer_read(imember->resample_buffer, imember->frame, bytes))) { if ((imember->read = (uint32_t) switch_buffer_read(imember->resample_buffer, imember->frame, bytes))) {
@ -798,15 +797,12 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
ready++; ready++;
} }
} }
} else { } else {
//printf("DOH %d %d %s\n", (int) buf_read, (int) bytes, switch_channel_get_name(switch_core_session_get_channel(imember->session)));
imember->read = buf_read; imember->read = buf_read;
switch_set_flag_locked(imember, MFLAG_HAS_AUDIO); switch_set_flag_locked(imember, MFLAG_HAS_AUDIO);
ready++; ready++;
} }
} }
switch_mutex_unlock(imember->audio_in_mutex); switch_mutex_unlock(imember->audio_in_mutex);
} }
@ -917,7 +913,6 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
continue; continue;
} }
bptr = (int16_t *) imember->frame; bptr = (int16_t *) imember->frame;
muxed = (int16_t *) omember->mux_frame; muxed = (int16_t *) omember->mux_frame;
@ -970,7 +965,6 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t * thread,
pool = fnode->pool; pool = fnode->pool;
fnode = NULL; fnode = NULL;
switch_core_destroy_memory_pool(&pool); switch_core_destroy_memory_pool(&pool);
} }
switch_mutex_unlock(conference->mutex); switch_mutex_unlock(conference->mutex);
@ -1451,23 +1445,23 @@ static void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t * thread,
/* skip frames that are not actual media or when we are muted or silent */ /* 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)) { if ((talking || energy_level == 0) && switch_test_flag(member, MFLAG_CAN_SPEAK)) {
switch_audio_resampler_t *read_resampler = member->read_resampler;
void *data; void *data;
uint32_t datalen; uint32_t datalen;
if (member->read_resampler) { if (read_resampler) {
int16_t *bptr = (int16_t *) read_frame->data; int16_t *bptr = (int16_t *) read_frame->data;
int len = (int) read_frame->datalen; int len = (int) read_frame->datalen;
read_resampler->from_len = switch_short_to_float(bptr, read_resampler->from, (int) len / 2);
read_resampler->to_len = switch_resample_process(read_resampler,
read_resampler->from,
read_resampler->from_len,
read_resampler->to,
read_resampler->to_size, 0);
member->read_resampler->from_len = switch_short_to_float(bptr, member->read_resampler->from, (int) len / 2); switch_float_to_short(read_resampler->to, member->resample_out, read_resampler->to_len);
member->read_resampler->to_len = switch_resample_process(member->read_resampler, len = read_resampler->to_len * 2;
member->read_resampler->from,
member->read_resampler->from_len,
member->read_resampler->to,
member->read_resampler->to_size, 0);
switch_float_to_short(member->read_resampler->to, member->resample_out, member->read_resampler->to_len);
len = member->read_resampler->to_len * 2;
datalen = len; datalen = len;
data = member->resample_out; data = member->resample_out;
} else { } else {