]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
commit both 8k and 16k versions
authorBrian West <brian@freeswitch.org>
Wed, 6 Sep 2006 17:57:38 +0000 (17:57 +0000)
committerBrian West <brian@freeswitch.org>
Wed, 6 Sep 2006 17:57:38 +0000 (17:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2535 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/codecs/mod_g722/mod_g722.c

index 91f8029f4fde7e56a622cf93d4d48a40f8ec1917..cd16cf21a6709bb507962d862f652a41f830d3b2 100644 (file)
@@ -53,23 +53,22 @@ static switch_status_t switch_g722_init(switch_codec_t *codec, switch_codec_flag
        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;   
 }