Changeset 5619
- Timestamp:
- Jul 5, 2017 3:57:53 AM (7 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r5597 r5619 744 744 745 745 /** 746 * This specifies if the SDP negotiator should compare its content before 747 * incrementing the origin version on the subsequent offer/answer. 748 * If this is set to 1, origin version will only by incremented if the 749 * new offer/answer is different than the previous one. For backward 750 * compatibility and performance this is set to 0. 751 * 752 * Default is 0 (No) 753 */ 754 #ifndef PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION 755 # define PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION 0 756 #endif 757 758 759 /** 746 760 * Support for sending and decoding RTCP port in SDP (RFC 3605). 747 761 * Default is equal to PJMEDIA_ADVERTISE_RTCP setting. -
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r5170 r5619 335 335 pj_strdup(pool, &new_offer->origin.user, &old_offer->origin.user); 336 336 new_offer->origin.id = old_offer->origin.id; 337 new_offer->origin.version = old_offer->origin.version + 1; 337 338 338 pj_strdup(pool, &new_offer->origin.net_type, &old_offer->origin.net_type); 339 339 pj_strdup(pool, &new_offer->origin.addr_type,&old_offer->origin.addr_type); … … 400 400 401 401 /* New_offer fixed */ 402 #if PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION 403 new_offer->origin.version = old_offer->origin.version; 404 405 if (pjmedia_sdp_session_cmp(new_offer, neg->initial_sdp, 0) != PJ_SUCCESS) 406 { 407 ++new_offer->origin.version; 408 } 409 #else 410 new_offer->origin.version = old_offer->origin.version + 1; 411 #endif 412 402 413 neg->initial_sdp_tmp = neg->initial_sdp; 403 414 neg->initial_sdp = new_offer; … … 1475 1486 active_ver = neg->initial_sdp->origin.version; 1476 1487 1488 #if PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION 1489 answer->origin.version = active_ver; 1490 1491 if ((neg->active_local_sdp == NULL) || 1492 (pjmedia_sdp_session_cmp(answer, neg->active_local_sdp, 0) 1493 != PJ_SUCCESS)) 1494 { 1495 ++answer->origin.version; 1496 } 1497 #else 1498 answer->origin.version = active_ver + 1; 1499 #endif 1477 1500 /* Only update active SDPs when negotiation is successfull */ 1478 1501 neg->active_local_sdp = answer; 1479 1502 neg->active_remote_sdp = neg->neg_remote_sdp; 1480 1481 /* Increment SDP version */1482 neg->active_local_sdp->origin.version = ++active_ver;1483 1503 } 1484 1504 } -
pjproject/trunk/pjmedia/src/test/sdp_neg_test.c
r3553 r5619 662 662 /* This is how Bob's answer should look like: */ 663 663 "v=0\r\n" 664 #if PJMEDIA_SDP_NEG_COMPARE_BEFORE_INC_VERSION 665 "o=bob 2808844564 2808844564 IN IP4 host.biloxi.example.com\r\n" 666 #else 664 667 "o=bob 2808844564 2808844565 IN IP4 host.biloxi.example.com\r\n" 668 #endif 665 669 "s=bob\r\n" 666 670 "c=IN IP4 host.biloxi.example.com\r\n"
Note: See TracChangeset
for help on using the changeset viewer.