Changeset 2477


Ignore:
Timestamp:
Feb 24, 2009 11:29:40 AM (10 years ago)
Author:
nanang
Message:

Ticket #730: 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/trunk/pjmedia/src/pjmedia/stream.c

    r2446 r2477  
    16601660 
    16611661    /* Init jitter buffer parameters: */ 
    1662     if (info->jb_max > 0) 
    1663         jb_max = info->jb_max; 
     1662    if (info->jb_max >= stream->codec_param.info.frm_ptime) 
     1663        jb_max = (info->jb_max + stream->codec_param.info.frm_ptime - 1) /  
     1664                 stream->codec_param.info.frm_ptime; 
    16641665    else 
    16651666        jb_max = 500 / stream->codec_param.info.frm_ptime; 
    16661667 
    1667     if (info->jb_min_pre > 0) 
    1668         jb_min_pre = info->jb_min_pre; 
     1668    if (info->jb_min_pre >= stream->codec_param.info.frm_ptime) 
     1669        jb_min_pre = info->jb_min_pre / stream->codec_param.info.frm_ptime; 
    16691670    else 
    16701671        //jb_min_pre = 60 / stream->codec_param.info.frm_ptime; 
    16711672        jb_min_pre = 1; 
    16721673 
    1673     if (info->jb_max_pre > 0) 
    1674         jb_max_pre = info->jb_max_pre; 
     1674    if (info->jb_max_pre >= stream->codec_param.info.frm_ptime) 
     1675        jb_max_pre = info->jb_max_pre / stream->codec_param.info.frm_ptime; 
    16751676    else 
    16761677        //jb_max_pre = 240 / stream->codec_param.info.frm_ptime; 
    16771678        jb_max_pre = jb_max * 4 / 5; 
    16781679 
    1679     if (info->jb_init > 0) 
    1680         jb_init = info->jb_init; 
     1680    if (info->jb_init >= stream->codec_param.info.frm_ptime) 
     1681        jb_init = info->jb_init / stream->codec_param.info.frm_ptime; 
    16811682    else 
    16821683        //jb_init = (jb_min_pre + jb_max_pre) / 2; 
Note: See TracChangeset for help on using the changeset viewer.