diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc index e36ecafeed..667668053d 100644 --- a/pc/jsep_transport_controller.cc +++ b/pc/jsep_transport_controller.cc @@ -813,7 +813,8 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups( if (config_.bundle_policy == PeerConnectionInterface::kBundlePolicyMaxBundle && - !description->HasGroup(cricket::GROUP_TYPE_BUNDLE)) { + !description->HasGroup(cricket::GROUP_TYPE_BUNDLE) && + description->contents().size() > 1) { return RTCError(RTCErrorType::INVALID_PARAMETER, "max-bundle is used but no bundle group found."); } diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc index 8aecf63c5d..faa8842e35 100644 --- a/pc/jsep_transport_controller_unittest.cc +++ b/pc/jsep_transport_controller_unittest.cc @@ -2727,4 +2727,20 @@ TEST_F(JsepTransportControllerTest, BundleOnlySectionDoesNotNeedRtcpMux) { .ok()); } +// Test that with max-bundle a single unbundled m-line is accepted. +TEST_F(JsepTransportControllerTest, + MaxBundleDoesNotRequireBundleForFirstMline) { + auto config = JsepTransportController::Config(); + config.bundle_policy = PeerConnectionInterface::kBundlePolicyMaxBundle; + CreateJsepTransportController(std::move(config)); + + auto offer = std::make_unique(); + AddAudioSection(offer.get(), kAudioMid1, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + EXPECT_TRUE( + transport_controller_->SetRemoteDescription(SdpType::kOffer, offer.get()) + .ok()); +} + } // namespace webrtc