Skip to content

Commit d1f7899

Browse files
committed
FS-10529: [mod_native_file] mod_native_file: remove "opus" extension -- fix regression
1 parent e7269d7 commit d1f7899

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/mod/formats/mod_native_file/mod_native_file.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
181181

182182
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
183183
uint32_t num_codecs = switch_loadable_module_get_codecs(codecs, sizeof(codecs) / sizeof(codecs[0]));
184-
uint32_t x;
184+
uint32_t x, y = 0;
185185

186186
for (x = 0; x < num_codecs; x++) {
187-
if (codecs[x]->encoded_bytes_per_packet == 0) {
187+
if (codecs[x]->encoded_bytes_per_packet == 0 || codecs[x]->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
188188
continue;
189189
}
190-
supported_formats[x] = switch_core_strdup(pool, codecs[x]->iananame);
190+
191+
supported_formats[y++] = switch_core_strdup(pool, codecs[x]->iananame);
191192
}
192193

193194
*module_interface = switch_loadable_module_create_module_interface(pool, modname);

src/switch_pcm.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
394394
20000, /* number of microseconds per frame */
395395
160, /* number of samples per frame */
396396
320, /* number of bytes per frame decompressed */
397-
320, /* number of bytes per frame compressed */
397+
0, /* number of bytes per frame compressed */
398398
1, /* number of channels represented */
399399
1, /* number of frames per network packet */
400400
switch_proxy_init, /* function to initialize a codec handle using this implementation */
@@ -413,7 +413,7 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
413413
20000, /* number of microseconds per frame */
414414
160, /* number of samples per frame */
415415
320 * 2, /* number of bytes per frame decompressed */
416-
320 * 2, /* number of bytes per frame compressed */
416+
0, /* number of bytes per frame compressed */
417417
2, /* number of channels represented */
418418
1, /* number of frames per network packet */
419419
switch_proxy_init, /* function to initialize a codec handle using this implementation */

0 commit comments

Comments
 (0)