Changeset 4115


Ignore:
Timestamp:
Apr 30, 2012 2:34:40 AM (13 years ago)
Author:
nanang
Message:

Fix #1501: Added max incoming framerate state in video stream to check for increasing framerate (before triggering PJMEDIA_EVENT_FMT_CHANGED event).

File:
1 edited

Legend:

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

    r4099 r4115  
    126126 
    127127    unsigned                 dec_max_size;  /**< Size of decoded/raw picture*/ 
     128    pjmedia_ratio            dec_max_fps;   /**< Max fps of decoding dir.   */ 
    128129    pjmedia_frame            dec_frame;     /**< Current decoded frame.     */ 
    129130    pjmedia_event            fmt_event;     /**< Buffered fmt_changed event 
     
    10811082                vfd->fps.num * ts_diff) 
    10821083            { 
    1083                 pjmedia_ratio old_fps; 
    1084  
    1085                 old_fps = vfd->fps; 
    1086  
    10871084                /* Frame rate changed, update decoding port info */ 
    10881085                if (stream->info.codec_info.clock_rate % ts_diff == 0) { 
     
    11001097                 * increased and not exceeding 100fps. 
    11011098                 */ 
    1102                 if (vfd->fps.num/vfd->fps.denum < 100 && 
    1103                     vfd->fps.num*old_fps.denum > old_fps.num*vfd->fps.denum) 
     1099                if (vfd->fps.num/vfd->fps.denum <= 100 && 
     1100                    vfd->fps.num * stream->dec_max_fps.denum > 
     1101                    stream->dec_max_fps.num * vfd->fps.denum) 
    11041102                { 
    11051103                    pjmedia_event *event = &stream->fmt_event; 
     1104 
     1105                    /* Update max fps of decoding dir */ 
     1106                    stream->dec_max_fps = vfd->fps; 
    11061107 
    11071108                    /* Use the buffered format changed event: 
     
    14961497     */ 
    14971498    vfd_dec->fps.num = vfd_dec->fps.num * 3 / 2; 
     1499    stream->dec_max_fps = vfd_dec->fps; 
    14981500 
    14991501    /* Create decoder channel */ 
Note: See TracChangeset for help on using the changeset viewer.