Changeset 5129
- Timestamp:
- Jul 8, 2015 10:17:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r5114 r5129 39 39 40 40 pjmedia_sdp_session *initial_sdp, /**< Initial local SDP */ 41 *initial_sdp_tmp, /**< Temporary initial local SDP */ 41 42 *active_local_sdp, /**< Currently active local SDP. */ 42 43 *active_remote_sdp, /**< Currently active remote's. */ … … 399 400 400 401 /* New_offer fixed */ 402 neg->initial_sdp_tmp = neg->initial_sdp; 401 403 neg->initial_sdp = new_offer; 402 404 neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, new_offer); … … 424 426 PJ_ASSERT_RETURN(neg->active_local_sdp, PJMEDIA_SDPNEG_ENOACTIVE); 425 427 428 /* Retain initial SDP */ 429 if (neg->initial_sdp) { 430 neg->initial_sdp_tmp = neg->initial_sdp; 431 neg->initial_sdp = pjmedia_sdp_session_clone(pool, 432 neg->initial_sdp); 433 } 434 426 435 neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER; 427 436 neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, 428 437 neg->active_local_sdp); 429 neg->initial_sdp = pjmedia_sdp_session_clone(pool,430 neg->active_local_sdp);431 438 *offer = neg->active_local_sdp; 432 439 … … 438 445 } 439 446 440 441 447 return PJ_SUCCESS; 442 448 } … … 506 512 if (neg->initial_sdp) { 507 513 /* Retain initial_sdp value. */ 514 neg->initial_sdp_tmp = neg->initial_sdp; 508 515 neg->initial_sdp = pjmedia_sdp_session_clone(pool, 509 516 neg->initial_sdp); … … 521 528 } else { 522 529 PJ_ASSERT_RETURN(neg->initial_sdp, PJMEDIA_SDPNEG_ENOINITIAL); 530 neg->initial_sdp_tmp = neg->initial_sdp; 523 531 neg->initial_sdp = pjmedia_sdp_session_clone(pool, neg->initial_sdp); 524 532 neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, neg->initial_sdp); … … 1400 1408 PJMEDIA_SDPNEG_EINSTATE); 1401 1409 1402 /* Clear temporary SDP */1403 neg->neg_local_sdp = neg->neg_remote_sdp = NULL;1404 neg->has_remote_answer = PJ_FALSE;1405 1406 1410 if (neg->state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER && 1407 1411 neg->active_local_sdp) … … 1414 1418 } 1415 1419 1420 /* Revert back initial SDP */ 1421 if (neg->state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) 1422 neg->initial_sdp = neg->initial_sdp_tmp; 1423 1424 /* Clear temporary SDP */ 1425 neg->initial_sdp_tmp = NULL; 1426 neg->neg_local_sdp = neg->neg_remote_sdp = NULL; 1427 neg->has_remote_answer = PJ_FALSE; 1428 1416 1429 /* Reset state to done */ 1417 1430 neg->state = PJMEDIA_SDP_NEG_STATE_DONE; … … 1477 1490 neg->answer_was_remote = neg->has_remote_answer; 1478 1491 1492 /* Revert back initial SDP if nego fails */ 1493 if (status != PJ_SUCCESS) 1494 neg->initial_sdp = neg->initial_sdp_tmp; 1495 1479 1496 /* Clear temporary SDP */ 1497 neg->initial_sdp_tmp = NULL; 1480 1498 neg->neg_local_sdp = neg->neg_remote_sdp = NULL; 1481 1499 neg->has_remote_answer = PJ_FALSE;
Note: See TracChangeset
for help on using the changeset viewer.