mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-31 07:34:19 +00:00
FS-12008: special case G722 - fix rate passed to switch_core_codec_init()
This commit is contained in:
1 parent
a4c5802372
commit
797216fcc0
3 files changed
+23
-1
No files matched your search
@@ -8,6 +8,9 @@
|
||||
<load module="mod_console"/>
|
||||
<load module="mod_loopback"/>
|
||||
<load module="mod_opus"/>
|
||||
<load module="mod_spandsp"/>
|
||||
<load module="mod_amr"/>
|
||||
<load module="mod_amrwb"/>
|
||||
</modules>
|
||||
</configuration>
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ FST_CORE_BEGIN("./conf")
|
||||
FST_SETUP_BEGIN()
|
||||
{
|
||||
fst_requires_module("mod_opus");
|
||||
fst_requires_module("mod_spandsp");
|
||||
}
|
||||
FST_SETUP_END()
|
||||
|
||||
@@ -101,6 +102,20 @@ FST_CORE_BEGIN("./conf")
|
||||
switch_core_codec_copy(&orig_codec, &new_codec, NULL, NULL);
|
||||
fst_check(orig_codec.implementation->samples_per_second == new_codec.implementation->samples_per_second);
|
||||
fst_check(orig_codec.implementation->actual_samples_per_second == new_codec.implementation->actual_samples_per_second);
|
||||
|
||||
status = switch_core_codec_init(&orig_codec,
|
||||
"G722",
|
||||
"mod_spandsp",
|
||||
NULL,
|
||||
8000,
|
||||
20,
|
||||
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
|
||||
&codec_settings, fst_pool);
|
||||
fst_check(status == SWITCH_STATUS_SUCCESS);
|
||||
|
||||
switch_core_codec_copy(&orig_codec, &new_codec, NULL, NULL);
|
||||
fst_check(orig_codec.implementation->samples_per_second == new_codec.implementation->samples_per_second);
|
||||
fst_check(orig_codec.implementation->actual_samples_per_second == new_codec.implementation->actual_samples_per_second);
|
||||
|
||||
}
|
||||
FST_TEST_END()
|
||||
|
||||
Reference in new issue
Block a user