git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3018 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-10-09 23:00:11 +00:00
parent 672842361b
commit ed15d399a0
1 changed files with 2 additions and 8 deletions

View File

@ -200,7 +200,7 @@ static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_
context->decoder_state = NULL; context->decoder_state = NULL;
if (encoding) { if (encoding) {
context->encoder_state = Encoder_Interface_init(1); context->encoder_state = Encoder_Interface_init(0);
} }
if (decoding) { if (decoding) {
@ -268,13 +268,7 @@ static switch_status_t switch_amr_decode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
if (encoded_data_len == 1) { Decoder_Interface_Decode(context->decoder_state, (unsigned char *)encoded_data, (int16_t *)decoded_data, 0);
memset(decoded_data, 255, codec->implementation->bytes_per_frame);
*flag |= SFF_CNG;
} else {
Decoder_Interface_Decode( context->decoder_state, (unsigned char *)encoded_data, (int16_t *)decoded_data, 0 );
}
*decoded_data_len = codec->implementation->bytes_per_frame; *decoded_data_len = codec->implementation->bytes_per_frame;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;