diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2024-02-05 06:24:59 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2024-02-09 05:17:39 +0100 |
commit | 7df04b20d593242c589ad1d95977a04ad1da77be (patch) | |
tree | c69a29088369eae458f0f902237faaa7506b1eeb | |
parent | 4873b59eb96b160d7e8fd2fba2d3d155fb2931b7 (diff) |
select remote's first codec
Change-Id: I21452edfce34ced393ebb83a5a8b2a746f78d9c6
-rw-r--r-- | src/libmsc/codec_filter.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libmsc/codec_filter.c b/src/libmsc/codec_filter.c index 87bad9457..7f3fc1fbe 100644 --- a/src/libmsc/codec_filter.c +++ b/src/libmsc/codec_filter.c @@ -66,6 +66,11 @@ int codec_filter_run(struct codec_filter *codec_filter, struct sdp_msg *result, * assigned codec from the filter result, and it is the CC code's responsibility to detect this and * assign a working codec instead. */ sdp_audio_codecs_select(r, a); + } else if (remote && remote->audio_codecs.count) { + /* If we haven't assigned yet, favor remote's first pick. Assume that the remote side has placed its + * favorite codec up first. Remote may already have assigned a codec, and picking a different one might + * trigger a change of codec mode (Re-Assignment). So try to adhere to the first codec listed. */ + sdp_audio_codecs_select(r, &remote->audio_codecs.codec[0]); } return 0; } |