Changeset 2478


Ignore:
Timestamp:
Feb 24, 2009 4:17:27 PM (11 years ago)
Author:
nanang
Message:

Ticket #731: Fixed stream to convert units of jitter buffer params, from msecs (in stream info) to frame counts (for jitter buffer).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0/pjmedia/src/pjmedia/stream.c

    r2394 r2478  
    16681668 
    16691669    /* Init jitter buffer parameters: */ 
    1670     if (info->jb_max > 0) 
    1671         jb_max = info->jb_max; 
     1670    if (info->jb_max >= stream->codec_param.info.frm_ptime) 
     1671        jb_max = (info->jb_max + stream->codec_param.info.frm_ptime - 1) / 
     1672                 stream->codec_param.info.frm_ptime; 
    16721673    else 
    16731674        jb_max = 500 / stream->codec_param.info.frm_ptime; 
    16741675 
    1675     if (info->jb_min_pre > 0) 
    1676         jb_min_pre = info->jb_min_pre; 
     1676    if (info->jb_min_pre >= stream->codec_param.info.frm_ptime) 
     1677        jb_min_pre = info->jb_min_pre / stream->codec_param.info.frm_ptime; 
    16771678    else 
    16781679        //jb_min_pre = 60 / stream->codec_param.info.frm_ptime; 
    16791680        jb_min_pre = 1; 
    16801681 
    1681     if (info->jb_max_pre > 0) 
    1682         jb_max_pre = info->jb_max_pre; 
     1682    if (info->jb_max_pre >= stream->codec_param.info.frm_ptime) 
     1683        jb_max_pre = info->jb_max_pre / stream->codec_param.info.frm_ptime; 
    16831684    else 
    16841685        //jb_max_pre = 240 / stream->codec_param.info.frm_ptime; 
    16851686        jb_max_pre = jb_max * 4 / 5; 
    16861687 
    1687     if (info->jb_init > 0) 
    1688         jb_init = info->jb_init; 
     1688    if (info->jb_init >= stream->codec_param.info.frm_ptime) 
     1689        jb_init = info->jb_init / stream->codec_param.info.frm_ptime; 
    16891690    else 
    16901691        //jb_init = (jb_min_pre + jb_max_pre) / 2; 
Note: See TracChangeset for help on using the changeset viewer.