提交 8d056f52 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix core

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@863 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a2c448e1
...@@ -189,7 +189,7 @@ static switch_status switch_g729_decode(switch_codec *codec, ...@@ -189,7 +189,7 @@ static switch_status switch_g729_decode(switch_codec *codec,
} else { } else {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "yo this frame is an odd size [%d]\n", encoded_data_len); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "yo this frame is an odd size [%d]\n", encoded_data_len);
return SWITCH_STATUS_FALSE;
} }
...@@ -202,6 +202,22 @@ static switch_status switch_g729_decode(switch_codec *codec, ...@@ -202,6 +202,22 @@ static switch_status switch_g729_decode(switch_codec *codec,
/* Registration */ /* Registration */
static const switch_codec_implementation g729_10ms_8k_implementation = {
/*.samples_per_second */ 8000,
/*.bits_per_second */ 32000,
/*.microseconds_per_frame */ 10000,
/*.samples_per_frame */ 80,
/*.bytes_per_frame */ 160,
/*.encoded_bytes_per_frame */ 10,
/*.number_of_channels */ 1,
/*.pref_frames_per_packet */ 1,
/*.max_frames_per_packet */ 1,
/*.init */ switch_g729_init,
/*.encode */ switch_g729_encode,
/*.decode */ switch_g729_decode,
/*.destroy */ switch_g729_destroy,
};
static const switch_codec_implementation g729_8k_implementation = { static const switch_codec_implementation g729_8k_implementation = {
/*.samples_per_second */ 8000, /*.samples_per_second */ 8000,
/*.bits_per_second */ 64000, /*.bits_per_second */ 64000,
...@@ -216,6 +232,7 @@ static const switch_codec_implementation g729_8k_implementation = { ...@@ -216,6 +232,7 @@ static const switch_codec_implementation g729_8k_implementation = {
/*.encode */ switch_g729_encode, /*.encode */ switch_g729_encode,
/*.decode */ switch_g729_decode, /*.decode */ switch_g729_decode,
/*.destroy */ switch_g729_destroy, /*.destroy */ switch_g729_destroy,
&g729_10ms_8k_implementation
}; };
......
...@@ -691,6 +691,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj) ...@@ -691,6 +691,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
int stream_id = 0, ans_a = 0, ans_b = 0; int stream_id = 0, ans_a = 0, ans_b = 0;
switch_dtmf_callback_function dtmf_callback; switch_dtmf_callback_function dtmf_callback;
void *user_data; void *user_data;
int *his_status;
switch_channel *chan_a, *chan_b; switch_channel *chan_a, *chan_b;
switch_frame *read_frame; switch_frame *read_frame;
...@@ -702,6 +703,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj) ...@@ -702,6 +703,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
stream_id_p = data->objs[2]; stream_id_p = data->objs[2];
dtmf_callback = data->objs[3]; dtmf_callback = data->objs[3];
user_data = data->objs[4]; user_data = data->objs[4];
his_status = data->objs[5];
if (stream_id_p) { if (stream_id_p) {
stream_id = *stream_id_p; stream_id = *stream_id_p;
...@@ -715,7 +717,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj) ...@@ -715,7 +717,7 @@ static void *audio_bridge_thread(switch_thread *thread, void *obj)
ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED); ans_b = switch_channel_test_flag(chan_b, CF_ANSWERED);
while (data->running > 0) { while (data->running > 0 && *his_status > 0) {
switch_channel_state b_state = switch_channel_get_state(chan_b); switch_channel_state b_state = switch_channel_get_state(chan_b);
switch (b_state) { switch (b_state) {
...@@ -877,7 +879,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi ...@@ -877,7 +879,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
other_audio_thread.objs[2] = &stream_id; other_audio_thread.objs[2] = &stream_id;
other_audio_thread.objs[3] = dtmf_callback; other_audio_thread.objs[3] = dtmf_callback;
other_audio_thread.objs[4] = session_data; other_audio_thread.objs[4] = session_data;
other_audio_thread.objs[5] = &this_audio_thread.running;
other_audio_thread.running = 5; other_audio_thread.running = 5;
this_audio_thread.objs[0] = peer_session; this_audio_thread.objs[0] = peer_session;
...@@ -885,6 +887,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi ...@@ -885,6 +887,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
this_audio_thread.objs[2] = &stream_id; this_audio_thread.objs[2] = &stream_id;
this_audio_thread.objs[3] = dtmf_callback; this_audio_thread.objs[3] = dtmf_callback;
this_audio_thread.objs[4] = peer_session_data; this_audio_thread.objs[4] = peer_session_data;
this_audio_thread.objs[5] = &other_audio_thread.running;
this_audio_thread.running = 2; this_audio_thread.running = 2;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论