[Freeswitch-svn] [commit] r3283 - freeswitch/trunk/src/mod/codecs/mod_g722

Freeswitch SVN brian at freeswitch.org
Wed Nov 8 16:33:04 EST 2006


Author: brian
Date: Wed Nov  8 16:33:03 2006
New Revision: 3283

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

Log:
fix g722 with help from tony. Thanks.

Modified: freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c	Wed Nov  8 16:33:03 2006
@@ -87,9 +87,8 @@
 		return SWITCH_STATUS_FALSE; 
 	}
 
-
-	*encoded_data_len = g722_encode(&context->encoder_object, encoded_data, decoded_data, 160);
-
+	*encoded_data_len = g722_encode(&context->encoder_object, (uint8_t *) encoded_data, (int16_t *) decoded_data, decoded_data_len / 2);
+	
 	return SWITCH_STATUS_SUCCESS;
 }
 
@@ -107,8 +106,8 @@
 		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;
 }
 
@@ -149,8 +148,8 @@
 	/*.samples_per_second */ 16000,
 	/*.bits_per_second */ 64000,
 	/*.microseconds_per_frame */ 20000,
-	/*.samples_per_frame */ 160,
-	/*.bytes_per_frame */ 320,
+	/*.samples_per_frame */ 320,
+	/*.bytes_per_frame */ 640,
 	/*.encoded_bytes_per_frame */ 160,
 	/*.number_of_channels */ 1,
 	/*.pref_frames_per_packet */ 1,



More information about the Freeswitch-svn mailing list