summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuboš Doležel <lubos@dolezel.info>2020-04-01 08:28:48 +0200
committerGitHub <noreply@github.com>2020-04-01 08:28:48 +0200
commitfd1f2304e41e98370ea429405ea025d413de67ef (patch)
tree6b4484ed735f270ba1e1490c943ab3dc163963a2
parentf5e4266b3f199e68976a68f96a9d7ae44c589429 (diff)
parentae62caebc6769f96d7ffc2e7e4f4e6e07ec0f0fb (diff)
downloadtwinkle-fd1f2304e41e98370ea429405ea025d413de67ef.tar
twinkle-fd1f2304e41e98370ea429405ea025d413de67ef.tar.gz
twinkle-fd1f2304e41e98370ea429405ea025d413de67ef.tar.lz
twinkle-fd1f2304e41e98370ea429405ea025d413de67ef.tar.xz
twinkle-fd1f2304e41e98370ea429405ea025d413de67ef.zip
Merge pull request #201 from fbriere/issue/184-sdp-duplicate-codecs
Use the first payload type number for each codec in the SDP answer
-rw-r--r--src/session.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/session.cpp b/src/session.cpp
index ae816fa..2007791 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -44,7 +44,10 @@ void t_session::set_recvd_codecs(t_sdp *sdp) {
t_audio_codec ac = sdp->get_codec(SDP_AUDIO, *i);
if (ac > CODEC_UNSUPPORTED) {
recvd_codecs.push_back(ac);
- send_ac2payload[ac] = *i;
+ // Don't overwrite any previous mapping for this codec
+ if (!send_ac2payload.count(ac)) {
+ send_ac2payload[ac] = *i;
+ }
send_payload2ac[*i] = ac;
}
}