Bug 1401540 - Allow empty BUNDLE groups; r?bwc
MozReview-Commit-ID: 9IIwUnaMZ1m
--- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
+++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp
@@ -3620,16 +3620,30 @@ TEST_F(JsepSessionTest, ValidateAnswered
fmtps[2].parameters.get());
ASSERT_EQ((uint32_t)0x42a00d, parsed_h264_0_params.profile_level_id);
ASSERT_TRUE(parsed_h264_0_params.level_asymmetry_allowed);
ASSERT_EQ(0U, parsed_h264_0_params.packetization_mode);
#endif
}
+TEST_F(JsepSessionTest, OfferWithBundleGroupNoTags)
+{
+ AddTracks(*mSessionOff, "audio,video");
+ AddTracks(*mSessionAns, "audio,video");
+
+ std::string offer = CreateOffer();
+ size_t i = offer.find("a=group:BUNDLE");
+ offer.insert(i, "a=group:BUNDLE\r\n");
+
+ SetLocalOffer(offer, CHECK_SUCCESS);
+ SetRemoteOffer(offer, CHECK_SUCCESS);
+ std::string answer(CreateAnswer());
+}
+
static void
Replace(const std::string& toReplace,
const std::string& with,
std::string* in)
{
size_t pos = in->find(toReplace);
ASSERT_NE(std::string::npos, pos);
in->replace(pos, toReplace.size(), with);
--- a/media/webrtc/signaling/src/sdp/SdpHelper.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpHelper.cpp
@@ -202,18 +202,17 @@ SdpHelper::GetBundleGroups(
nsresult
SdpHelper::GetBundledMids(const Sdp& sdp, BundledMids* bundledMids)
{
std::vector<SdpGroupAttributeList::Group> bundleGroups;
GetBundleGroups(sdp, &bundleGroups);
for (SdpGroupAttributeList::Group& group : bundleGroups) {
if (group.tags.empty()) {
- SDP_SET_ERROR("Empty BUNDLE group");
- return NS_ERROR_INVALID_ARG;
+ continue;
}
const SdpMediaSection* masterBundleMsection(
FindMsectionByMid(sdp, group.tags[0]));
if (!masterBundleMsection) {
SDP_SET_ERROR("mid specified for bundle transport in group attribute"
" does not exist in the SDP. (mid=" << group.tags[0] << ")");