shithub: openh264

Download patch

ref: 655f3b43b64bdb2329f15b613cd4eb843cf71d6a
parent: a291470072896d43ab154af4e90bd3c5052b3177
author: Martin Storsjö <[email protected]>
date: Thu Oct 30 07:07:22 EDT 2014

Add a cast when converting from int64_t to float

This avoids a warning when building with MSVC.

--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -617,8 +617,8 @@
 
   // rate control related
   if (0 != m_pEncContext->uiStartTimestamp && kiCurrentFrameTs > m_pEncContext->uiStartTimestamp + 800) {
-    pStatistics->fAverageFrameRate = pStatistics->uiInputFrameCount * 1000 /
-                                     (kiCurrentFrameTs - m_pEncContext->uiStartTimestamp);
+    pStatistics->fAverageFrameRate = (float) (pStatistics->uiInputFrameCount * 1000 /
+                                     (kiCurrentFrameTs - m_pEncContext->uiStartTimestamp));
   } else {
     m_pEncContext->uiStartTimestamp = kiCurrentFrameTs;
   }