[Encoder] fix timestamp = 0 issue when rc mode is BITRATE mode
Showing the changes to codec/encoder/core/src/ratectl.cpp (1 of 6 files). Show all
Unified · Split
| @@ -1544,4 +1544,11 @@ void WelsRcFreeMemory (sWelsEncCtx* pEncCtx) { · 1543 unmodified lines | |||
| 1544 | } | 1544 | } |
| 1545 | } | 1545 | } |
| 1546 | 1546 | ||
| 1547 | long long GetTimestampForRc(const long long uiTimeStamp, const long long uiLastTimeStamp, const float fFrameRate) { | ||
| 1548 | if ((uiLastTimeStamp >= uiTimeStamp) || ((uiTimeStamp == 0) && (uiLastTimeStamp != -1))) { | ||
| 1549 | return (uiLastTimeStamp + (int32_t) (1000.0 / fFrameRate)); | ||
| 1550 | } | ||
| 1551 | return uiTimeStamp; | ||
| 1552 | } | ||
| 1553 | |||
| 1547 | }//end of namespace | 1554 | }//end of namespace |