|
|
|
@ -6566,11 +6566,15 @@ static int ast_channel_make_compatible_helper(struct ast_channel *from, struct a
|
|
|
|
|
* to use SLINEAR between channels, but only if there is
|
|
|
|
|
* no direct conversion available. If generic PLC is
|
|
|
|
|
* desired, then transcoding via SLINEAR is a requirement
|
|
|
|
|
* even if the formats are the same.
|
|
|
|
|
*/
|
|
|
|
|
if (ast_format_cmp(best_dst_fmt, best_src_fmt) == AST_FORMAT_CMP_NOT_EQUAL
|
|
|
|
|
&& (ast_opt_generic_plc || ast_opt_transcode_via_slin)) {
|
|
|
|
|
if (ast_opt_generic_plc_on_equal_codecs
|
|
|
|
|
|| (ast_format_cmp(best_dst_fmt, best_src_fmt) == AST_FORMAT_CMP_NOT_EQUAL
|
|
|
|
|
&& (ast_opt_generic_plc || ast_opt_transcode_via_slin))) {
|
|
|
|
|
|
|
|
|
|
int use_slin = (ast_format_cache_is_slinear(best_src_fmt)
|
|
|
|
|
|| ast_format_cache_is_slinear(best_dst_fmt)) ? 1 : 0;
|
|
|
|
|
|| ast_format_cache_is_slinear(best_dst_fmt))
|
|
|
|
|
? 1 : ast_opt_generic_plc_on_equal_codecs;
|
|
|
|
|
|
|
|
|
|
if (use_slin || ast_translate_path_steps(best_dst_fmt, best_src_fmt) != 1) {
|
|
|
|
|
int best_sample_rate = (ast_format_get_sample_rate(best_src_fmt) > ast_format_get_sample_rate(best_dst_fmt)) ?
|
|
|
|
@ -7664,8 +7668,17 @@ int ast_plc_reload(void)
|
|
|
|
|
for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) {
|
|
|
|
|
if (!strcasecmp(var->name, "genericplc")) {
|
|
|
|
|
ast_set2_flag(&ast_options, ast_true(var->value), AST_OPT_FLAG_GENERIC_PLC);
|
|
|
|
|
} else if (!strcasecmp(var->name, "genericplc_on_equal_codecs")) {
|
|
|
|
|
ast_set2_flag(&ast_options, ast_true(var->value), AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Force on_equal_codecs to false if generic_plc is false.
|
|
|
|
|
*/
|
|
|
|
|
if (!ast_opt_generic_plc) {
|
|
|
|
|
ast_set2_flag(&ast_options, 0, AST_OPT_FLAG_GENERIC_PLC_ON_EQUAL_CODECS);
|
|
|
|
|
}
|
|
|
|
|
ast_config_destroy(cfg);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|