From ae6a661fb77c7deb28b9191f046c97abbfc95fa9 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 31 Aug 2006 01:48:17 +0000 Subject: [PATCH] more work git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2467 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/codecs/mod_amr/mod_amr.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mod/codecs/mod_amr/mod_amr.c b/src/mod/codecs/mod_amr/mod_amr.c index 152b11ce3f..ca8368393b 100644 --- a/src/mod/codecs/mod_amr/mod_amr.c +++ b/src/mod/codecs/mod_amr/mod_amr.c @@ -63,7 +63,7 @@ static const char modname[] = "mod_amr"; struct amr_context { void *encoder_state; void *decoder_state; - int mode; + int enc_mode; }; enum @@ -105,7 +105,7 @@ static switch_status_t switch_amr_init(switch_codec_t *codec, switch_codec_flag_ return SWITCH_STATUS_FALSE; } else { - context->mode = AMR_Mode; /* start in mode 7 */ + context->enc_mode = AMR_Mode; /* start in mode 7 */ context->encoder_state = NULL; context->decoder_state = NULL; @@ -155,7 +155,7 @@ static switch_status_t switch_amr_encode(switch_codec_t *codec, return SWITCH_STATUS_FALSE; } - *encoded_data_len = Encoder_Interface_Encode(context->encoder_state, context->mode, (void *)decoded_data, encoded_data, 0); + *encoded_data_len = Encoder_Interface_Encode( context->encoder_state, context->enc_mode, (void *)decoded_data, encoded_data, 0 ); return SWITCH_STATUS_SUCCESS; } @@ -173,14 +173,15 @@ static switch_status_t switch_amr_decode(switch_codec_t *codec, unsigned int *flag) { struct amr_context *context = codec->private_info; + //int dec_mode; - context->mode = *(char *)encoded_data & 0xF; + //dec_mode = (*(char *)encoded_data >> 3) & 0xF; if (!context) { return SWITCH_STATUS_FALSE; } - Decoder_Interface_Decode( context, (void *)encoded_data, (void *)decoded_data, 0 ); + Decoder_Interface_Decode( context->decoder_state, (void *)encoded_data, (void *)decoded_data, 0 ); *decoded_data_len = codec->implementation->samples_per_frame;