summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/rtp_transceiver.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/pc/rtp_transceiver.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/third_party/libwebrtc/pc/rtp_transceiver.cc b/third_party/libwebrtc/pc/rtp_transceiver.cc
index ca626cc94b..34d744a3bb 100644
--- a/third_party/libwebrtc/pc/rtp_transceiver.cc
+++ b/third_party/libwebrtc/pc/rtp_transceiver.cc
@@ -51,9 +51,7 @@ RTCError VerifyCodecPreferences(
// transceiver.direction.
if (!absl::c_any_of(codecs, [&recv_codecs](const RtpCodecCapability& codec) {
- return codec.name != cricket::kRtxCodecName &&
- codec.name != cricket::kRedCodecName &&
- codec.name != cricket::kFlexfecCodecName &&
+ return codec.IsMediaCodec() &&
absl::c_any_of(recv_codecs,
[&codec](const cricket::Codec& recv_codec) {
return recv_codec.MatchesRtpCodec(codec);
@@ -65,9 +63,7 @@ RTCError VerifyCodecPreferences(
}
if (!absl::c_any_of(codecs, [&send_codecs](const RtpCodecCapability& codec) {
- return codec.name != cricket::kRtxCodecName &&
- codec.name != cricket::kRedCodecName &&
- codec.name != cricket::kFlexfecCodecName &&
+ return codec.IsMediaCodec() &&
absl::c_any_of(send_codecs,
[&codec](const cricket::Codec& send_codec) {
return send_codec.MatchesRtpCodec(codec);
@@ -101,11 +97,9 @@ RTCError VerifyCodecPreferences(
}
}
- // Check we have a real codec (not just rtx, red or fec)
+ // Check we have a real codec (not just rtx, red, fec or CN)
if (absl::c_all_of(codecs, [](const RtpCodecCapability& codec) {
- return codec.name == cricket::kRtxCodecName ||
- codec.name == cricket::kRedCodecName ||
- codec.name == cricket::kUlpfecCodecName;
+ return !codec.IsMediaCodec();
})) {
LOG_AND_RETURN_ERROR(
RTCErrorType::INVALID_MODIFICATION,