shithub: openh264

Download patch

ref: 3f290e7ff7f83d51ea0760aa0da48e39ad75fea3
parent: 5542dda121cb2c8da2eda4833cf6316964701ce7
author: Martin Storsjö <martin@martin.st>
date: Thu Jan 25 04:31:27 EST 2018

Fix errors and warnings when building with msvc and for android with stlport

This fixes the following two kinds of errors and warnings:
encode_options_test.cpp(2305) : error C2668: 'pow' : ambiguous call to overloaded function
        math.h(583): could be 'long double pow(long double,int)'
        math.h(535): or       'float pow(float,int)'
        math.h(497): or       'double pow(double,int)'
        while trying to match the argument list '(int, int)'

encode_options_test.cpp(2305) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data

--- a/test/api/encode_options_test.cpp
+++ b/test/api/encode_options_test.cpp
@@ -2302,7 +2302,7 @@
       if ( (iStepIdx < 3) && (iFrameNum == ((iTotalFrame / 3) * (iStepIdx + 1)))) {
         sParam.iTemporalLayerNum = originalTemporalLayerNum * iSteps[iStepIdx];
         sParam.iTargetBitrate = sParam.sSpatialLayers[0].iSpatialBitrate = originalBR * iSteps[iStepIdx];
-        sParam.fMaxFrameRate = sParam.sSpatialLayers[0].fFrameRate = originalFR * pow (2, iSteps[iStepIdx]);
+        sParam.fMaxFrameRate = sParam.sSpatialLayers[0].fFrameRate = originalFR * pow (2.0f, iSteps[iStepIdx]);
         encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam);
 
         bSetOption = true;