diff --git a/src/Extension/SPSParser.c b/src/Extension/SPSParser.c index ecd69862..6f6995cf 100644 --- a/src/Extension/SPSParser.c +++ b/src/Extension/SPSParser.c @@ -2194,21 +2194,14 @@ int h264GetFormat(T_SPS *ptSps) void h264GeFramerate(T_SPS *ptSps, float *pfFramerate) { - int iFrInt = 0; + if(ptSps->iTimingInfoPresentFlag) { - if(!ptSps->iFixedFrameRateFlag) - { - *pfFramerate = (float)ptSps->u32TimeScale / (float)ptSps->u32NumUnitsInTick; - //iFrInt = ptSps->vui_parameters.u32TimeScale / ptSps->vui_parameters.u32NumUnitsInTick; - }else - { - *pfFramerate = (float)ptSps->u32TimeScale / (float)ptSps->u32NumUnitsInTick / 2.0; - //iFrInt = ptSps->vui_parameters.u32TimeScale / ptSps->vui_parameters.u32NumUnitsInTick / 2; - } - iFrInt = ptSps->u32TimeScale / ptSps->u32NumUnitsInTick / 2; + *pfFramerate = (float)ptSps->u32TimeScale / (float)ptSps->u32NumUnitsInTick / 2.0; + }else{ + *pfFramerate = 0; } - switch(iFrInt) + switch((int)*pfFramerate) { case 23:// 23.98 RPT(RPT_DBG, "frame rate:23.98");