diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 9ae87d885c..e8cfece9bf 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -304,7 +304,7 @@ static void playSource(sp &source) { seekTimeUs = -1; if (shouldSeek) { - seekTimeUs = (rand() * (float)durationUs) / RAND_MAX; + seekTimeUs = (rand() * (float)durationUs) / (float)RAND_MAX; options.setSeekTo(seekTimeUs); printf("seeking to %" PRId64 " us (%.2f secs)\n", diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 965e5a6366..e7488a15d2 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -2436,7 +2436,7 @@ status_t ACodec::setOperatingRate(float rateFloat, bool isVideo) { } rate = (OMX_U32)(rateFloat * 65536.0f + 0.5f); } else { - if (rateFloat > UINT_MAX) { + if (rateFloat > (float)UINT_MAX) { return BAD_VALUE; } rate = (OMX_U32)(rateFloat); diff --git a/media/libstagefright/MediaClock.cpp b/media/libstagefright/MediaClock.cpp index 4f9bc6d32f..24608a7996 100644 --- a/media/libstagefright/MediaClock.cpp +++ b/media/libstagefright/MediaClock.cpp @@ -281,7 +281,7 @@ void MediaClock::processTimers_l() { it = mTimers.erase(it); } else { if (mPlaybackRate != 0.0 - && (double)diffMediaUs < INT64_MAX * (double)mPlaybackRate) { + && (double)diffMediaUs < (double)INT64_MAX * (double)mPlaybackRate) { int64_t targetRealUs = diffMediaUs / (double)mPlaybackRate; if (targetRealUs < nextLapseRealUs) { nextLapseRealUs = targetRealUs; diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp index ac4d08713e..fc70091ee2 100644 --- a/media/libstagefright/Utils.cpp +++ b/media/libstagefright/Utils.cpp @@ -1874,7 +1874,7 @@ void convertMessageToMetaData(const sp &msg, sp &meta) { if (msg->findInt32("frame-rate", &fps) && fps > 0) { meta->setInt32(kKeyFrameRate, fps); } else if (msg->findFloat("frame-rate", &fpsFloat) - && fpsFloat >= 1 && fpsFloat <= INT32_MAX) { + && fpsFloat >= 1 && fpsFloat <= (float)INT32_MAX) { // truncate values to distinguish between e.g. 24 vs 23.976 fps meta->setInt32(kKeyFrameRate, (int32_t)fpsFloat); } diff --git a/media/libstagefright/codecs/mp3dec/src/pv_mp3dec_fxd_op_c_equivalent.h b/media/libstagefright/codecs/mp3dec/src/pv_mp3dec_fxd_op_c_equivalent.h index adb0dd4ec7..f9d91b1903 100644 --- a/media/libstagefright/codecs/mp3dec/src/pv_mp3dec_fxd_op_c_equivalent.h +++ b/media/libstagefright/codecs/mp3dec/src/pv_mp3dec_fxd_op_c_equivalent.h @@ -44,7 +44,7 @@ extern "C" #endif #include "pvmp3_audio_type_defs.h" -#define Qfmt_31(a) (Int32)((float)(a)*0x7FFFFFFF) +#define Qfmt_31(a) (Int32)((float)(a)*(float)0x7FFFFFFF) #define Qfmt15(x) (Int16)((x)*((Int32)1<<15) + ((x)>=0?0.5F:-0.5F)) diff --git a/media/libstagefright/codecs/mp3dec/src/pvmp3_alias_reduction.cpp b/media/libstagefright/codecs/mp3dec/src/pvmp3_alias_reduction.cpp index af738ba5f3..6c8102b998 100644 --- a/media/libstagefright/codecs/mp3dec/src/pvmp3_alias_reduction.cpp +++ b/media/libstagefright/codecs/mp3dec/src/pvmp3_alias_reduction.cpp @@ -169,7 +169,7 @@ void pvmp3_alias_reduction(int32 *input_buffer, /* Ptr to spec values of int32 i, j; - *used_freq_lines = fxp_mul32_Q32(*used_freq_lines << 16, (int32)(0x7FFFFFFF / (float)18 - 1.0f)) >> 15; + *used_freq_lines = fxp_mul32_Q32(*used_freq_lines << 16, (int32)((float)0x7FFFFFFF / (float)18 - 1.0f)) >> 15; if (gr_info->window_switching_flag && gr_info->block_type == 2) diff --git a/media/libstagefright/codecs/mp3dec/src/pvmp3_dct_9.cpp b/media/libstagefright/codecs/mp3dec/src/pvmp3_dct_9.cpp index bbb247d344..9cd0e91452 100644 --- a/media/libstagefright/codecs/mp3dec/src/pvmp3_dct_9.cpp +++ b/media/libstagefright/codecs/mp3dec/src/pvmp3_dct_9.cpp @@ -77,7 +77,7 @@ Returns ; Include all pre-processor statements here. Include conditional ; compile variables also. ----------------------------------------------------------------------------*/ -#define Qfmt31(a) (int32)((a)*(0x7FFFFFFF)) +#define Qfmt31(a) (int32)((a)*((float)0x7FFFFFFF)) #define cos_pi_9 Qfmt31( 0.93969262078591f) #define cos_2pi_9 Qfmt31( 0.76604444311898f)