shithub: openh264

Download patch

ref: fbe35cffca060bfdca70b4d860774c2824a5f7c1
parent: d11f12db54682e80a48d352a96577e3a34b162cc
author: Martin Storsjö <martin@martin.st>
date: Sat Jan 16 06:10:25 EST 2016

Avoid warnings in MSVC about implicitly casting floats to integers

--- a/codec/encoder/core/src/ratectl.cpp
+++ b/codec/encoder/core/src/ratectl.cpp
@@ -1292,8 +1292,8 @@
   int32_t iBitRate = pDLayerConfig->iSpatialBitrate;
   int32_t iEncTimeInv = (pWelsSvcRc->uiLastTimeStamp == 0) ? 0 : (int32_t) (uiTimeStamp - pWelsSvcRc->uiLastTimeStamp);
   if ((iEncTimeInv < 0) || (iEncTimeInv > 1000)) {
-    pWelsSvcRc->uiLastTimeStamp = uiTimeStamp - 1000.0 / pDLayerConfig->fFrameRate;
-    iEncTimeInv = 1000.0 / pDLayerConfig->fFrameRate;
+    iEncTimeInv = (int32_t) (1000.0 / pDLayerConfig->fFrameRate);
+    pWelsSvcRc->uiLastTimeStamp = uiTimeStamp - iEncTimeInv;
   }
   int32_t iSentBits  = (int32_t) ((double)iBitRate * iEncTimeInv * (1.0E-3) + 0.5);
   iSentBits = WELS_MAX (iSentBits, 0);