]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10529: [mod_native_file] mod_native_file: remove "opus" extension -- fix regression
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 17 Aug 2017 21:08:34 +0000 (16:08 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 17 Aug 2017 21:08:40 +0000 (16:08 -0500)
src/mod/formats/mod_native_file/mod_native_file.c
src/switch_pcm.c

index 1cfe1740a7e1f9aef07ffdb005767f1b7ca72572..4d406c3e1b4edd378b38db21a0a6305ea78ba563 100644 (file)
@@ -181,13 +181,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
 
        const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
        uint32_t num_codecs = switch_loadable_module_get_codecs(codecs, sizeof(codecs) / sizeof(codecs[0]));
-       uint32_t x;
+       uint32_t x, y = 0;
 
        for (x = 0; x < num_codecs; x++) {
-               if (codecs[x]->encoded_bytes_per_packet == 0) {
+               if (codecs[x]->encoded_bytes_per_packet == 0 || codecs[x]->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
                        continue;
                }
-               supported_formats[x] = switch_core_strdup(pool, codecs[x]->iananame);
+
+               supported_formats[y++] = switch_core_strdup(pool, codecs[x]->iananame);
        }
 
        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
index 44eb55986312db3e6e8d69369511fae6f769ecce..a37bdb8ea6f35c2d8ba040d4cd6b3f8c20906833 100644 (file)
@@ -394,7 +394,7 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                                                                                 20000, /* number of microseconds per frame */
                                                                                 160,   /* number of samples per frame */
                                                                                 320,   /* number of bytes per frame decompressed */
-                                                                                320,   /* number of bytes per frame compressed */
+                                                                                0,     /* number of bytes per frame compressed */
                                                                                 1,     /* number of channels represented */
                                                                                 1,     /* number of frames per network packet */
                                                                                 switch_proxy_init,     /* function to initialize a codec handle using this implementation */
@@ -413,7 +413,7 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                                                                                 20000, /* number of microseconds per frame */
                                                                                 160, /* number of samples per frame */
                                                                                 320 * 2, /* number of bytes per frame decompressed */
-                                                                                320 * 2, /* number of bytes per frame compressed */
+                                                                                0, /* number of bytes per frame compressed */
                                                                                 2, /* number of channels represented */
                                                                                 1, /* number of frames per network packet */
                                                                                 switch_proxy_init, /* function to initialize a codec handle using this implementation */