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

Commit 8d9a6e7b authored by James Dong's avatar James Dong Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add avg bandwidth estimate every 2 seconds - do not merge."" into honeycomb-mr2

parents f29f1307 a0383833
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@ NuHTTPDataSource::NuHTTPDataSource(uint32_t flags)
      mNumBandwidthHistoryItems(0),
      mTotalTransferTimeUs(0),
      mTotalTransferBytes(0),
      mPrevBandwidthMeasureTimeUs(0),
      mDecryptHandle(NULL),
      mDrmManagerClient(NULL) {
}
@@ -535,16 +534,6 @@ void NuHTTPDataSource::addBandwidthMeasurement_l(
        mTotalTransferBytes -= entry->mNumBytes;
        mBandwidthHistory.erase(mBandwidthHistory.begin());
        --mNumBandwidthHistoryItems;
        int64_t timeNowUs = ALooper::GetNowUs();
        if (timeNowUs - mPrevBandwidthMeasureTimeUs > 2000000LL) {
            if (mPrevBandwidthMeasureTimeUs != 0) {
                double estimatedBandwidth =
                    ((double)mTotalTransferBytes * 8E3 / mTotalTransferTimeUs);
                LOGI("estimated avg bandwidth is %8.2f kbps in the past %lld us",
                    estimatedBandwidth, timeNowUs - mPrevBandwidthMeasureTimeUs);
            }
            mPrevBandwidthMeasureTimeUs = timeNowUs;
        }
    }
}

+0 −1
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ private:
    size_t mNumBandwidthHistoryItems;
    int64_t mTotalTransferTimeUs;
    size_t mTotalTransferBytes;
    int64_t mPrevBandwidthMeasureTimeUs;

    DecryptHandle *mDecryptHandle;
    DrmManagerClient *mDrmManagerClient;