simulcast: Limit audio transceivers to single stream
We don't support audio simulcast, so we should reject the layers
early during an addTransceiver() call.
Bug: webrtc:12719
Change-Id: Ieeb92c66de741e9b11943e0173a6f2e052926f13
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/216685
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33886}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index 0323636..e2b3b61 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -997,9 +997,11 @@
parameters.encodings = init.send_encodings;
// Encodings are dropped from the tail if too many are provided.
- if (parameters.encodings.size() > kMaxSimulcastStreams) {
+ size_t max_simulcast_streams =
+ media_type == cricket::MEDIA_TYPE_VIDEO ? kMaxSimulcastStreams : 1u;
+ if (parameters.encodings.size() > max_simulcast_streams) {
parameters.encodings.erase(
- parameters.encodings.begin() + kMaxSimulcastStreams,
+ parameters.encodings.begin() + max_simulcast_streams,
parameters.encodings.end());
}