Browse Source

Moved data after non-data media in description

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

+ 13 - 12
src/description.cpp

@@ -220,18 +220,6 @@ string Description::generateSdp(const string &eol) const {
 
 
 	sdp << "a=msid-semantic: WMS" << eol;
 	sdp << "a=msid-semantic: WMS" << eol;
 
 
-	// Data
-	const string dataDescription = "UDP/DTLS/SCTP webrtc-datachannel";
-	sdp << "m=application" << ' ' << (!mMedia.empty() ? 0 : 9) << ' ' << dataDescription << eol;
-	sdp << "c=IN IP4 0.0.0.0" << eol;
-	if (!mMedia.empty())
-		sdp << "a=bundle-only" << eol;
-	sdp << "a=mid:" << mData.mid << eol;
-	if (mData.sctpPort)
-		sdp << "a=sctp-port:" << *mData.sctpPort << eol;
-	if (mData.maxMessageSize)
-		sdp << "a=max-message-size:" << *mData.maxMessageSize << eol;
-
 	// Non-data media
 	// Non-data media
 	if (!mMedia.empty()) {
 	if (!mMedia.empty()) {
 		// Lip-sync
 		// Lip-sync
@@ -252,6 +240,19 @@ string Description::generateSdp(const string &eol) const {
 		}
 		}
 	}
 	}
 
 
+	// Data
+	const string dataDescription = "UDP/DTLS/SCTP webrtc-datachannel";
+	sdp << "m=application" << ' ' << (!mMedia.empty() ? 0 : 9) << ' ' << dataDescription << eol;
+	sdp << "c=IN IP4 0.0.0.0" << eol;
+	if (!mMedia.empty())
+		sdp << "a=bundle-only" << eol;
+	sdp << "a=mid:" << mData.mid << eol;
+	if (mData.sctpPort)
+		sdp << "a=sctp-port:" << *mData.sctpPort << eol;
+	if (mData.maxMessageSize)
+		sdp << "a=max-message-size:" << *mData.maxMessageSize << eol;
+
+
 	// Common
 	// Common
 	if (!mEnded)
 	if (!mEnded)
 		sdp << "a=ice-options:trickle" << eol;
 		sdp << "a=ice-options:trickle" << eol;