Changeset 3975 for pjproject/trunk
- Timestamp:
- Mar 14, 2012 12:36:42 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r3955 r3975 1012 1012 1013 1013 /* Learn remote frame rate after successful decoding */ 1014 if ( 0 &&frame->type == PJMEDIA_FRAME_TYPE_VIDEO && frame->size)1014 if (frame->type == PJMEDIA_FRAME_TYPE_VIDEO && frame->size) 1015 1015 { 1016 1016 /* Only check remote frame rate when timestamp is not wrapping and … … 1026 1026 vfd = pjmedia_format_get_video_format_detail( 1027 1027 &channel->port.info.fmt, PJ_TRUE); 1028 if ( (int)(stream->info.codec_info.clock_rate / ts_diff)!=1029 vfd->fps.num / vfd->fps.denum)1028 if (stream->info.codec_info.clock_rate * vfd->fps.denum != 1029 vfd->fps.num * ts_diff) 1030 1030 { 1031 1031 /* Frame rate changed, update decoding port info */ 1032 vfd->fps.num = stream->info.codec_info.clock_rate; 1033 vfd->fps.denum = ts_diff; 1032 if (stream->info.codec_info.clock_rate % ts_diff == 0) { 1033 vfd->fps.num = stream->info.codec_info.clock_rate/ts_diff; 1034 vfd->fps.denum = 1; 1035 } else { 1036 vfd->fps.num = stream->info.codec_info.clock_rate; 1037 vfd->fps.denum = ts_diff; 1038 } 1034 1039 1035 1040 /* Update stream info */ 1036 1041 stream->info.codec_param->dec_fmt.det.vid.fps = vfd->fps; 1037 1042 1038 PJ_LOG( 5, (channel->port.info.name.ptr,1039 "Frame rate changed to %d/%d(~%d)fps",1043 PJ_LOG(6, (channel->port.info.name.ptr, 1044 "Frame rate update: %d/%d(~%.2f)fps", 1040 1045 vfd->fps.num, vfd->fps.denum, 1041 vfd->fps.num / vfd->fps.denum));1046 vfd->fps.num*1.0 / vfd->fps.denum)); 1042 1047 1043 1048 /* Publish PJMEDIA_EVENT_FMT_CHANGED event */ 1044 {1049 if (0) { 1045 1050 pjmedia_event event; 1046 1051
Note: See TracChangeset
for help on using the changeset viewer.