[Freeswitch-svn] [commit] r2535 - freeswitch/trunk/src/mod/codecs/mod_g722
Freeswitch SVN
brian at freeswitch.org
Wed Sep 6 13:57:39 EDT 2006
Author: brian
Date: Wed Sep 6 13:57:38 2006
New Revision: 2535
Modified:
freeswitch/trunk/src/mod/codecs/mod_g722/mod_g722.c
Log:
commit both 8k and 16k versions
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 Sep 6 13:57:38 2006
@@ -53,23 +53,22 @@
if (!(encoding || decoding) || (!(context = switch_core_alloc(codec->memory_pool, sizeof(struct g722_context))))) {
return SWITCH_STATUS_FALSE;
} else {
- if (!(encoding || decoding)) {
- if (encoding) {
- if(codec->implementation->samples_per_second == 16000){
- g722_encode_init(&context->encoder_object, 64000, G722_PACKED);
- } else {
- g722_encode_init(&context->encoder_object, 64000, G722_SAMPLE_RATE_8000);
- }
+ if (encoding) {
+ if(codec->implementation->samples_per_second == 16000){
+ g722_encode_init(&context->encoder_object, 64000, G722_PACKED);
+ } else {
+ g722_encode_init(&context->encoder_object, 64000, G722_SAMPLE_RATE_8000);
}
- if (decoding) {
- if(codec->implementation->samples_per_second == 16000){
- g722_decode_init(&context->decoder_object, 64000, G722_PACKED);
- } else {
- g722_decode_init(&context->decoder_object, 64000, G722_SAMPLE_RATE_8000);
- }
+ }
+ if (decoding) {
+ if(codec->implementation->samples_per_second == 16000){
+ g722_decode_init(&context->decoder_object, 64000, G722_PACKED);
+ } else {
+ g722_decode_init(&context->decoder_object, 64000, G722_SAMPLE_RATE_8000);
}
}
}
+
codec->private_info = context;
return SWITCH_STATUS_SUCCESS;
}
More information about the Freeswitch-svn
mailing list