Changeset 5124


Ignore:
Timestamp:
Jul 1, 2015 4:46:26 AM (9 years ago)
Author:
ming
Message:

Fixed #1864: Assertion in PJSIP when remote remove and add back media lines in the SDP

Thanks to Brian Walker for the report and patch testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r5099 r5124  
    2929#   define PJSUA_REQUIRE_CONSECUTIVE_RTCP_PORT  0 
    3030#endif 
     31 
     32static void stop_media_stream(pjsua_call *call, unsigned med_idx); 
    3133 
    3234static void pjsua_media_config_dup(pj_pool_t *pool, 
     
    15251527 
    15261528 
    1527 /* Clean up media transports in provisional media that is not used 
    1528  * by call media. 
     1529/* If idx == 0, clean up media transports in provisional media that 
     1530 * is not used by call media, else clean up media transports starting 
     1531 * from index idx that have been removed by remote. 
    15291532 */ 
    15301533static void media_prov_clean_up(pjsua_call_id call_id, int idx) 
     
    15331536    unsigned i; 
    15341537 
    1535     if (call->med_prov_cnt > call->med_cnt) { 
     1538    if (idx > 0 || call->med_prov_cnt > call->med_cnt) { 
    15361539        PJ_LOG(4,(THIS_FILE, "Call %d: cleaning up provisional media, " 
    15371540                             "prov_med_cnt=%d, med_cnt=%d", 
    1538                              call_id, call->med_prov_cnt, call->med_cnt)); 
     1541                             call_id, (idx == 0? call->med_prov_cnt: idx), 
     1542                             call->med_cnt)); 
    15391543    } 
    15401544 
     
    15481552 
    15491553        for (j = 0; j < call->med_cnt; ++j) { 
    1550             if (call->media[j].tp == call_med->tp) { 
     1554            if (idx == 0 && call->media[j].tp == call_med->tp) { 
    15511555                used = PJ_TRUE; 
    15521556                break; 
     
    19861990        if (rem_sdp && mi >= rem_sdp->media_count) { 
    19871991            /* Remote might have removed some media lines. */ 
     1992            for (i = rem_sdp->media_count; i < call->med_prov_cnt; ++i) { 
     1993                stop_media_stream(call, i); 
     1994            } 
    19881995            media_prov_clean_up(call->index, rem_sdp->media_count); 
    19891996            call->med_prov_cnt = rem_sdp->media_count; 
Note: See TracChangeset for help on using the changeset viewer.