Changeset 1708


Ignore:
Timestamp:
Jan 18, 2008 6:38:48 PM (11 years ago)
Author:
bennylp
Message:

Ticket #452: updated ICE media transport's media_create() to consider the media index when updating SDP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/users/nanang/pjmedia/src/pjmedia/transport_ice.c

    r1702 r1708  
    264264{ 
    265265    struct transport_ice *tp_ice = (struct transport_ice*)tp; 
     266    pj_ice_sess_role ice_role; 
    266267    enum { MAXLEN = 256 }; 
    267268    char *buffer; 
    268269    pjmedia_sdp_attr *attr; 
    269270    unsigned i, cand_cnt; 
    270  
    271     PJ_UNUSED_ARG(sdp_remote); 
     271    pj_status_t status; 
     272 
     273    /* Init ICE */ 
     274    ice_role = (sdp_remote==NULL ? PJ_ICE_SESS_ROLE_CONTROLLING :  
     275                                   PJ_ICE_SESS_ROLE_CONTROLLED); 
     276 
     277    status = pjmedia_ice_init_ice(tp, ice_role, NULL, NULL); 
     278    if (status != PJ_SUCCESS) 
     279        return status; 
     280 
    272281 
    273282    buffer = (char*) pj_pool_alloc(pool, MAXLEN); 
     
    287296    for (i=0; i<cand_cnt; ++i) { 
    288297        pj_ice_sess_cand *cand; 
     298        pjmedia_sdp_media *m; 
    289299        pj_str_t value; 
    290300        int len; 
     
    336346        value = pj_str(buffer); 
    337347        attr = pjmedia_sdp_attr_create(pool, "candidate", &value); 
    338         sdp_local->media[0]->attr[sdp_local->media[0]->attr_count++] = attr; 
     348        m = sdp_local->media[media_index]; 
     349        m->attr[m->attr_count++] = attr; 
    339350    } 
    340351 
Note: See TracChangeset for help on using the changeset viewer.