@@ -310,7 +310,6 @@ string Description::generateSdp(string_view eol) const {
310
310
311
311
// Session-level attributes
312
312
sdp << " a=msid-semantic:WMS *" << eol;
313
-
314
313
if (!mIceOptions .empty ())
315
314
sdp << " a=ice-options:" << utils::implode (mIceOptions , ' ,' ) << eol;
316
315
if (mFingerprint )
@@ -372,28 +371,29 @@ string Description::generateApplicationSdp(string_view eol) const {
372
371
const uint16_t port =
373
372
cand && cand->isResolved () ? *cand->port () : 9 ; // Port 9 is the discard protocol
374
373
374
+ // Session-level attributes
375
+ sdp << " a=msid-semantic:WMS *" << eol;
376
+ if (!mIceOptions .empty ())
377
+ sdp << " a=ice-options:" << utils::implode (mIceOptions , ' ,' ) << eol;
378
+
379
+ for (const auto &attr : mAttributes )
380
+ sdp << " a=" << attr << eol;
381
+
375
382
// Application
376
383
auto app = mApplication ? mApplication : std::make_shared<Application>();
377
384
sdp << app->generateSdp (eol, addr, port);
378
385
379
- // Session-level attributes
380
- sdp << " a=msid-semantic:WMS *" << eol;
386
+ // Media-level attributes
381
387
sdp << " a=setup:" << mRole << eol;
382
-
383
388
if (mIceUfrag )
384
389
sdp << " a=ice-ufrag:" << *mIceUfrag << eol;
385
390
if (mIcePwd )
386
391
sdp << " a=ice-pwd:" << *mIcePwd << eol;
387
- if (!mIceOptions .empty ())
388
- sdp << " a=ice-options:" << utils::implode (mIceOptions , ' ,' ) << eol;
389
392
if (mFingerprint )
390
393
sdp << " a=fingerprint:"
391
394
<< CertificateFingerprint::AlgorithmIdentifier (mFingerprint ->algorithm ) << " "
392
395
<< mFingerprint ->value << eol;
393
396
394
- for (const auto &attr : mAttributes )
395
- sdp << " a=" << attr << eol;
396
-
397
397
// Candidates
398
398
for (const auto &candidate : mCandidates )
399
399
sdp << string (candidate) << eol;
0 commit comments