Skip to content

Commit ebc0e54

Browse files
shaunjstokesticpu
authored andcommitted
[core/media] allow transcoding between different rates in Opus
Fixes for issue #2226, we've found that the patch #2582 has the side effect of causing calls that fail to negotiate the same codec as Leg A for Leg B to fail with SIP 488 INCOMPATIBLE_DESTINATION. That's not an option for us, we need backwards compatibility with other codecs. Rather than apply this for all codecs it should only apply for Opus. Now calls using Opus and other codecs establish correctly on both legs, and there are no issues with codec negotiation when the codecs on Leg A and Leg B don't match. Tested-by: Jérôme Poulin <[email protected]>
1 parent 274dfdc commit ebc0e54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/switch_core_media.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5517,6 +5517,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
55175517
uint32_t bit_rate = imp->bits_per_second;
55185518
uint32_t codec_rate = imp->actual_samples_per_second;
55195519

5520+
if (!strcasecmp(map->rm_encoding, "opus")) {
5521+
codec_rate = imp->actual_samples_per_second;
5522+
}
5523+
55205524
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
55215525
continue;
55225526
}

0 commit comments

Comments
 (0)