提交 a3277bad authored 作者: Brian West's avatar Brian West

fix g722 with help from tony. Thanks.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3283 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 88a53a6b
...@@ -87,9 +87,8 @@ static switch_status_t switch_g722_encode(switch_codec_t *codec, ...@@ -87,9 +87,8 @@ static switch_status_t switch_g722_encode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
*encoded_data_len = g722_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
*encoded_data_len = g722_encode(&context->encoder_object, encoded_data, decoded_data, 160);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -107,8 +106,8 @@ static switch_status_t switch_g722_decode(switch_codec_t *codec, ...@@ -107,8 +106,8 @@ static switch_status_t switch_g722_decode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
*decoded_data_len = (2 * g722_decode(&context->decoder_object, decoded_data, encoded_data, 160)); *decoded_data_len = (2 * g722_decode(&context->decoder_object, (int16_t *) decoded_data, (uint8_t *) encoded_data, encoded_data_len));
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -149,8 +148,8 @@ static const switch_codec_implementation_t g722_16k_implementation = { ...@@ -149,8 +148,8 @@ static const switch_codec_implementation_t g722_16k_implementation = {
/*.samples_per_second */ 16000, /*.samples_per_second */ 16000,
/*.bits_per_second */ 64000, /*.bits_per_second */ 64000,
/*.microseconds_per_frame */ 20000, /*.microseconds_per_frame */ 20000,
/*.samples_per_frame */ 160, /*.samples_per_frame */ 320,
/*.bytes_per_frame */ 320, /*.bytes_per_frame */ 640,
/*.encoded_bytes_per_frame */ 160, /*.encoded_bytes_per_frame */ 160,
/*.number_of_channels */ 1, /*.number_of_channels */ 1,
/*.pref_frames_per_packet */ 1, /*.pref_frames_per_packet */ 1,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论