FS-4846 --resolve
This commit is contained in:
parent
c7b6327cfa
commit
e8ecf7c887
|
@ -2396,6 +2396,7 @@ SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
|||
SWITCH_DECLARE(const char *) switch_core_banner(void);
|
||||
SWITCH_DECLARE(switch_bool_t) switch_core_session_in_thread(switch_core_session_t *session);
|
||||
SWITCH_DECLARE(uint32_t) switch_default_ptime(const char *name, uint32_t number);
|
||||
SWITCH_DECLARE(uint32_t) switch_default_rate(const char *name, uint32_t number);
|
||||
|
||||
/*!
|
||||
\brief Add user registration
|
||||
|
|
|
@ -1720,6 +1720,16 @@ SWITCH_DECLARE(uint32_t) switch_default_ptime(const char *name, uint32_t number)
|
|||
return 20;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_default_rate(const char *name, uint32_t number)
|
||||
{
|
||||
|
||||
if (!strcasecmp(name, "opus")) {
|
||||
return 48000;
|
||||
}
|
||||
|
||||
return 8000;
|
||||
}
|
||||
|
||||
static uint32_t d_30 = 30;
|
||||
|
||||
static void switch_load_core_config(const char *file)
|
||||
|
|
|
@ -2165,7 +2165,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
|||
}
|
||||
|
||||
if (orate == 0) {
|
||||
orate = 8000;
|
||||
orate = switch_default_rate(name, 0);
|
||||
}
|
||||
|
||||
switch_copy_string(jbuf, prefs[j], sizeof(jbuf));
|
||||
|
@ -2176,7 +2176,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
|||
}
|
||||
|
||||
if (jrate == 0) {
|
||||
jrate = 8000;
|
||||
jrate = switch_default_rate(jname, 0);
|
||||
}
|
||||
|
||||
if (!strcasecmp(name, jname) && ointerval == jinterval && orate == jrate) {
|
||||
|
@ -2188,6 +2188,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
|||
/* If no specific codec interval is requested opt for the default above all else because lots of stuff assumes it */
|
||||
for (imp = codec_interface->implementations; imp; imp = imp->next) {
|
||||
uint32_t default_ptime = switch_default_ptime(imp->iananame, imp->ianacode);
|
||||
uint32_t default_rate = switch_default_rate(imp->iananame, imp->ianacode);
|
||||
|
||||
if (imp->codec_type != SWITCH_CODEC_TYPE_VIDEO) {
|
||||
|
||||
|
@ -2196,7 +2197,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
|
|||
continue;
|
||||
}
|
||||
|
||||
if (((!rate && (uint32_t) imp->samples_per_second != 8000) || (rate && (uint32_t) imp->samples_per_second != rate))) {
|
||||
if (((!rate && (uint32_t) imp->samples_per_second != default_rate) || (rate && (uint32_t) imp->samples_per_second != rate))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue