[Freeswitch-svn] [commit] r2467 - freeswitch/trunk/src/mod/codecs/mod_amr

Freeswitch SVN brian at freeswitch.org
Wed Aug 30 21:48:18 EDT 2006


Author: brian
Date: Wed Aug 30 21:48:17 2006
New Revision: 2467

Modified:
   freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c

Log:
more work

Modified: freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_amr/mod_amr.c	Wed Aug 30 21:48:17 2006
@@ -63,7 +63,7 @@
 struct amr_context {
 	void *encoder_state;
 	void *decoder_state;
-	int mode;
+	int enc_mode;
 };
 
 enum
@@ -105,7 +105,7 @@
 		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 @@
 		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 @@
 										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;
 



More information about the Freeswitch-svn mailing list