]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9197
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 2 Jun 2016 18:14:19 +0000 (13:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 2 Jun 2016 18:14:26 +0000 (13:14 -0500)
src/mod/codecs/mod_opus/mod_opus.c
src/switch_loadable_module.c

index e59565eec706417805bb94d6af17dbb8884d0758..959311b58bd19aa07408afe782d2b77dd44f12e6 100644 (file)
@@ -1244,27 +1244,27 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_opus_load)
                codec_interface->implementations->codec_control = switch_opus_control;
 
                settings.stereo = 1;
-               if (x < 2) {
-                       dft_fmtp = gen_fmtp(&settings, pool);
-                       switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,    /* enumeration defining the type of the codec */
-                                                                                                116,   /* the IANA code number */
-                                                                                                "opus",/* the IANA code name */
-                                                                                                dft_fmtp,      /* default fmtp to send (can be overridden by the init function) */
-                                                                                                rate,  /* samples transferred per second */
-                                                                                                rate,  /* actual samples transferred per second */
-                                                                                                bits,  /* bits transferred per second */
-                                                                                                mss,   /* number of microseconds per frame */
-                                                                                                samples,       /* number of samples per frame */
-                                                                                                bytes * 2,     /* number of bytes per frame decompressed */
-                                                                                                0,     /* number of bytes per frame compressed */
-                                                                                                2,/* number of channels represented */
-                                                                                                1,     /* number of frames per network packet */
-                                                                                                switch_opus_init,      /* function to initialize a codec handle using this implementation */
-                                                                                                switch_opus_encode,    /* function to encode raw data into encoded data */
-                                                                                                switch_opus_decode,    /* function to decode encoded data into raw data */
-                                                                                                switch_opus_destroy);  /* deinitalize a codec handle using this implementation */
-                       codec_interface->implementations->codec_control = switch_opus_control;
-               }
+
+               dft_fmtp = gen_fmtp(&settings, pool);
+               switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,    /* enumeration defining the type of the codec */
+                                                                                        116,   /* the IANA code number */
+                                                                                        "opus",/* the IANA code name */
+                                                                                        dft_fmtp,      /* default fmtp to send (can be overridden by the init function) */
+                                                                                        rate,  /* samples transferred per second */
+                                                                                        rate,  /* actual samples transferred per second */
+                                                                                        bits,  /* bits transferred per second */
+                                                                                        mss,   /* number of microseconds per frame */
+                                                                                        samples,       /* number of samples per frame */
+                                                                                        bytes * 2,     /* number of bytes per frame decompressed */
+                                                                                        0,     /* number of bytes per frame compressed */
+                                                                                        2,/* number of channels represented */
+                                                                                        1,     /* number of frames per network packet */
+                                                                                        switch_opus_init,      /* function to initialize a codec handle using this implementation */
+                                                                                        switch_opus_encode,    /* function to encode raw data into encoded data */
+                                                                                        switch_opus_decode,    /* function to decode encoded data into raw data */
+                                                                                        switch_opus_destroy);  /* deinitalize a codec handle using this implementation */
+               codec_interface->implementations->codec_control = switch_opus_control;
+       
                bytes *= 2;
                samples *= 2;
                mss *= 2;
index bc4289ac3773bc2be2e9421ea816a4321c817435..2b7c46cb1174f6a9b1f79ac4e2e9a4d96c6f202e 100644 (file)
@@ -205,15 +205,15 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
                                        for (impl = ptr->implementations; impl; impl = impl->next) {
                                                if (impl->bits_per_second) {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
-                                                                                         "Adding Codec %s %d %s %dhz %dms %dbps\n",
+                                                                                         "Adding Codec %s %d %s %dhz %dms %dch %dbps\n",
                                                                                          impl->iananame, impl->ianacode,
                                                                                          ptr->interface_name, impl->actual_samples_per_second, 
-                                                                                         impl->microseconds_per_packet / 1000, impl->bits_per_second);
+                                                                                         impl->microseconds_per_packet / 1000, impl->number_of_channels, impl->bits_per_second);
                                                } else {
                                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
-                                                                                         "Adding Codec %s %d %s %dhz %dms (VBR)\n",
+                                                                                         "Adding Codec %s %d %s %dhz %dms %dch (VBR)\n",
                                                                                          impl->iananame, impl->ianacode,
-                                                                                         ptr->interface_name, impl->actual_samples_per_second, impl->microseconds_per_packet / 1000);
+                                                                                         ptr->interface_name, impl->actual_samples_per_second, impl->microseconds_per_packet / 1000, impl->number_of_channels);
                                                }
 
                                                node = switch_core_alloc(new_module->pool, sizeof(*node));