Changeset 4003


Ignore:
Timestamp:
Mar 30, 2012 8:55:18 AM (8 years ago)
Author:
nanang
Message:

Fix #1475: Fixed wrong frame size calculation used for jitter buffer initialization in video stream, it should be based on PJMEDIA_MAX_MTU instead of encoder MTU setting.

File:
1 edited

Legend:

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

    r3998 r4003  
    12671267    pjmedia_video_format_detail *vfd_enc, *vfd_dec; 
    12681268    char *p; 
    1269     unsigned mtu; 
     1269    unsigned dec_mtu; 
    12701270    pj_status_t status; 
    12711271 
     
    13191319    if (info->codec_param->enc_mtu > PJMEDIA_MAX_MTU) 
    13201320        info->codec_param->enc_mtu = PJMEDIA_MAX_MTU; 
    1321     mtu = info->codec_param->enc_mtu; 
     1321 
     1322    /* MTU estimation for decoding direction */ 
     1323    dec_mtu = PJMEDIA_MAX_MTU; 
    13221324 
    13231325    vfd_enc = pjmedia_format_get_video_format_detail( 
     
    14211423    /* Init jitter buffer parameters: */ 
    14221424    frm_ptime       = 1000 * vfd_enc->fps.denum / vfd_enc->fps.num; 
    1423     chunks_per_frm  = stream->frame_size / mtu; 
     1425    chunks_per_frm  = stream->frame_size / dec_mtu; 
    14241426    if (chunks_per_frm == 0) chunks_per_frm = 1; 
    14251427 
     
    14571459    /* Create jitter buffer */ 
    14581460    status = pjmedia_jbuf_create(pool, &stream->dec->port.info.name, 
    1459                                  mtu + PJMEDIA_STREAM_RESV_PAYLOAD_LEN, 
     1461                                 dec_mtu + PJMEDIA_STREAM_RESV_PAYLOAD_LEN, 
    14601462                                 1000 * vfd_enc->fps.denum / vfd_enc->fps.num, 
    14611463                                 jb_max, &stream->jb); 
Note: See TracChangeset for help on using the changeset viewer.