Browse Source

Moved SDP common part under the first m-line

Paul-Louis Ageneau 5 years ago
parent
commit
48443e9e95
1 changed files with 12 additions and 10 deletions
  1. 12 10
      src/description.cpp

+ 12 - 10
src/description.cpp

@@ -257,19 +257,21 @@ string Description::generateSdp(const string &eol) const {
 			if (mData.maxMessageSize)
 				sdp << "a=max-message-size:" << *mData.maxMessageSize << eol;
 		}
-	}
 
-	// Common
-	if (!mEnded)
-		sdp << "a=ice-options:trickle" << eol;
+		if (i == 0) {
+			// Common
+			if (!mEnded)
+				sdp << "a=ice-options:trickle" << eol;
 
-	sdp << "a=ice-ufrag:" << mIceUfrag << eol;
-	sdp << "a=ice-pwd:" << mIcePwd << eol;
-	sdp << "a=setup:" << roleToString(mRole) << eol;
-	sdp << "a=tls-id:1" << eol;
+			sdp << "a=ice-ufrag:" << mIceUfrag << eol;
+			sdp << "a=ice-pwd:" << mIcePwd << eol;
+			sdp << "a=setup:" << roleToString(mRole) << eol;
+			sdp << "a=tls-id:1" << eol;
 
-	if (mFingerprint)
-		sdp << "a=fingerprint:sha-256 " << *mFingerprint << eol;
+			if (mFingerprint)
+				sdp << "a=fingerprint:sha-256 " << *mFingerprint << eol;
+		}
+	}
 
 	// Candidates
 	for (const auto &candidate : mCandidates)