Skip to content

Commit 274dfdc

Browse files
ticpumagiclin99
andcommitted
[core/media] make Opus consider rate different than default 48 kHz
In vars.xml , when you use codec settings like this: <X-PRE-PROCESS cmd="set" data="internal_codec_prefs=OPUS@16000h@1c,PCMU,PCMA,G729"/> The switch_core_media.c line 5520 only takes the OPUS default rate (48k) instead of 16k in the config. Because of this, FS won't be able to choose opus if your client asks for 16k opus. You will see same log symptom as #2226 Co-authored-by: magiclin99 <magiclin99@gmail.com>
1 parent 9d69bd6 commit 274dfdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/switch_core_media.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5515,7 +5515,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
55155515
for (i = 0; i < smh->mparams->num_codecs && i < total_codecs; i++) {
55165516
const switch_codec_implementation_t *imp = codec_array[i];
55175517
uint32_t bit_rate = imp->bits_per_second;
5518-
uint32_t codec_rate = imp->samples_per_second;
5518+
uint32_t codec_rate = imp->actual_samples_per_second;
55195519

55205520
if (imp->codec_type != SWITCH_CODEC_TYPE_AUDIO) {
55215521
continue;

0 commit comments

Comments
 (0)