修复获取帧率逻辑 (#1293)

This commit is contained in:
Dw9 2022-01-09 14:50:54 +08:00 committed by GitHub
parent 741b197f31
commit 819599ac25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2194,21 +2194,14 @@ int h264GetFormat(T_SPS *ptSps)
void h264GeFramerate(T_SPS *ptSps, float *pfFramerate) void h264GeFramerate(T_SPS *ptSps, float *pfFramerate)
{ {
int iFrInt = 0;
if(ptSps->iTimingInfoPresentFlag) 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; *pfFramerate = (float)ptSps->u32TimeScale / (float)ptSps->u32NumUnitsInTick / 2.0;
//iFrInt = ptSps->vui_parameters.u32TimeScale / ptSps->vui_parameters.u32NumUnitsInTick / 2; }else{
*pfFramerate = 0;
} }
iFrInt = ptSps->u32TimeScale / ptSps->u32NumUnitsInTick / 2; switch((int)*pfFramerate)
}
switch(iFrInt)
{ {
case 23:// 23.98 case 23:// 23.98
RPT(RPT_DBG, "frame rate:23.98"); RPT(RPT_DBG, "frame rate:23.98");