Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2dde082e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix -Wextra warnings in frameworks/av/include"

parents a7d9420d 27d3c6a3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -152,8 +152,8 @@ public:
                        : mLastSlope;
            } else {
                // finite difference spline
                m0 = (sec0 + sec) * 0.5;
                m1 = (sec1 + sec) * 0.5;
                m0 = (sec0 + sec) * 0.5f;
                m1 = (sec1 + sec) * 0.5f;
            }

            if (monotonic) {
@@ -294,7 +294,7 @@ public:

    std::string toString() const {
        std::stringstream ss;
        ss << "mInterpolatorType: " << mInterpolatorType << std::endl;
        ss << "mInterpolatorType: " << static_cast<int32_t>(mInterpolatorType) << std::endl;
        ss << "mFirstSlope: " << mFirstSlope << std::endl;
        ss << "mLastSlope: " << mLastSlope << std::endl;
        for (const auto &pt : *this) {
+10 −7
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ public:

        Configuration()
            : Interpolator<S, T>()
            , RefBase()
            , mType(TYPE_SCALE)
            , mId(-1)
            , mOptionFlags(OPTION_FLAG_NONE)
@@ -94,6 +95,7 @@ public:

        explicit Configuration(const Configuration &configuration)
            : Interpolator<S, T>(*static_cast<const Interpolator<S, T> *>(&configuration))
            , RefBase()
            , mType(configuration.mType)
            , mId(configuration.mId)
            , mOptionFlags(configuration.mOptionFlags)
@@ -147,7 +149,7 @@ public:

        T adjustVolume(T volume) const {
            if ((getOptionFlags() & OPTION_FLAG_VOLUME_IN_DBFS) != 0) {
                const T out = powf(10.f, volume / 10.);
                const T out = powf(10.f, volume / 10.0f);
                VS_LOG("in: %f  out: %f", volume, out);
                volume = out;
            }
@@ -261,10 +263,10 @@ public:

        std::string toString() const {
            std::stringstream ss;
            ss << "mType: " << mType << std::endl;
            ss << "mType: " << static_cast<int32_t>(mType) << std::endl;
            ss << "mId: " << mId << std::endl;
            if (mType != TYPE_ID) {
                ss << "mOptionFlags: " << mOptionFlags << std::endl;
                ss << "mOptionFlags: " << static_cast<int32_t>(mOptionFlags) << std::endl;
                ss << "mDurationMs: " << mDurationMs << std::endl;
                ss << Interpolator<S, T>::toString().c_str();
            }
@@ -362,7 +364,7 @@ public:

        std::string toString() const {
            std::stringstream ss;
            ss << "mFlags: " << mFlags << std::endl;
            ss << "mFlags: " << static_cast<int32_t>(mFlags) << std::endl;
            ss << "mReplaceId: " << mReplaceId << std::endl;
            ss << "mXOffset: " << mXOffset << std::endl;
            return ss.str();
@@ -500,14 +502,15 @@ public:
    void updatePosition(int64_t startFrame, double sampleRate) {
        double scale = (mConfiguration->last().first - mConfiguration->first().first)
                        / (mConfiguration->getDurationMs() * 0.001 * sampleRate);
        const double minScale = 1. / INT64_MAX;
        const double minScale = 1. / static_cast<double>(INT64_MAX);
        scale = std::max(scale, minScale);
        const S xOffset = std::isnan(mDelayXOffset) ? mConfiguration->first().first : mDelayXOffset;
        VS_LOG("update position: scale %lf  frameCount:%lld, sampleRate:%lf, xOffset:%f",
                scale, (long long) startFrame, sampleRate, xOffset);

        mXTranslate.setOffset(startFrame - xOffset / scale);
        mXTranslate.setScale(scale);
        mXTranslate.setOffset(static_cast<float>(static_cast<double>(startFrame)
                                                 - static_cast<double>(xOffset) / scale));
        mXTranslate.setScale(static_cast<float>(scale));
        VS_LOG("translate: %s", mXTranslate.toString().c_str());
    }