From d1f7899087dda58f133976e4e755c21dc43102e0 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 17 Aug 2017 16:08:34 -0500 Subject: [PATCH] FS-10529: [mod_native_file] mod_native_file: remove "opus" extension -- fix regression --- src/mod/formats/mod_native_file/mod_native_file.c | 7 ++++--- src/switch_pcm.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mod/formats/mod_native_file/mod_native_file.c b/src/mod/formats/mod_native_file/mod_native_file.c index 1cfe1740a7..4d406c3e1b 100644 --- a/src/mod/formats/mod_native_file/mod_native_file.c +++ b/src/mod/formats/mod_native_file/mod_native_file.c @@ -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); diff --git a/src/switch_pcm.c b/src/switch_pcm.c index 44eb559863..a37bdb8ea6 100644 --- a/src/switch_pcm.c +++ b/src/switch_pcm.c @@ -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 */