static int ast_channel_make_compatible_helper(struct ast_channel *from, struct ast_channel *to)
{
format_t src, dst;
+ int use_slin;
/* See if the channel driver can natively make these two channels compatible */
if (from->tech->bridge && from->tech->bridge == to->tech->bridge &&
* no direct conversion available. If generic PLC is
* desired, then transcoding via SLINEAR is a requirement
*/
+ use_slin = (src == AST_FORMAT_SLINEAR || dst == AST_FORMAT_SLINEAR);
if ((src != dst) && (ast_opt_generic_plc || ast_opt_transcode_via_slin) &&
- (ast_translate_path_steps(dst, src) != 1))
+ (ast_translate_path_steps(dst, src) != 1 || use_slin))
dst = AST_FORMAT_SLINEAR;
if (ast_set_read_format(from, dst) < 0) {
ast_log(LOG_WARNING, "Unable to set read format on channel %s to %s\n", from->name, ast_getformatname(dst));