mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
channel.c: Allow generic plc then channel formats are equal
If the two formats on a channel are equal, we don't transcode and since the generic plc needs slin to work, it doesn't get invoked. * A new configuration option "genericplc_on_equal_codecs" was added to the "plc" section of codecs.conf to allow generic packet loss concealment even if no transcoding was originally needed. Transcoding via SLIN is forced in this case. ASTERISK-27743 Change-Id: I0577026a179dea34232e63123254b4e0508378f4
This commit is contained in:
@@ -6485,11 +6485,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)) ?
|
||||
|
Reference in New Issue
Block a user