Changeset 3315 for pjproject


Ignore:
Timestamp:
Sep 22, 2010 8:39:03 AM (14 years ago)
Author:
nanang
Message:

Close #1133: added processing to remote SDP attribute "ptime".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/session.c

    r3237 r3315  
    527527    parse_fmtp(pool, local_m, si->fmt.pt, &si->param->setting.dec_fmtp); 
    528528 
     529    /* Get the remote ptime for our encoder. */ 
     530    attr = pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, 
     531                                  "ptime", NULL); 
     532    if (attr) { 
     533        pj_str_t tmp_val = attr->value; 
     534        unsigned frm_per_pkt; 
     535  
     536        pj_strltrim(&tmp_val); 
     537 
     538        /* Round up ptime when the specified is not multiple of frm_ptime */ 
     539        frm_per_pkt = (pj_strtoul(&tmp_val) + si->param->info.frm_ptime/2) / 
     540                      si->param->info.frm_ptime; 
     541        if (frm_per_pkt != 0) { 
     542            si->param->setting.frm_per_pkt = (pj_uint8_t)frm_per_pkt; 
     543        } 
     544    } 
     545 
    529546    /* Get remote maxptime for our encoder. */ 
    530547    attr = pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, 
Note: See TracChangeset for help on using the changeset viewer.