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

Commit dbdb5905 authored by Preetam Singh Ranawat's avatar Preetam Singh Ranawat Committed by Steve Kondik
Browse files

frameworks/av: Fix for failure in CTS MediaRecorderTest cases

 -Issue: MediaRecorder CTS test cases are failing.

 -Root Cause: Running the CTS test "testRecorderRandomAction" at beginning
  sets the huge file size and stargeFrightRecorder set the 64 bit file
  offset.
  In MPEG4 writer estimateMoovBoxSize depends on a static const
  variable which uses this file offset info.
  As the variable to calculate estimateMoovBoxSize is static const it
  remains same for next media recording session even if file size is small.

 -Fix: Don't use static const variable which is used to calculate
  estimateMoovBoxSize as its value may change depending on file offsets.

Change-Id: I6bd859fcd7951a4e78abc50bc99dab38e8284877
parent 019d7e91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -511,10 +511,10 @@ int64_t MPEG4Writer::estimateMoovBoxSize(int32_t bitRate) {

    // If the estimation is wrong, we will pay the price of wasting
    // some reserved space. This should not happen so often statistically.
    static const int32_t factor = mUse32BitOffset? 1: 2;
    static const int64_t MIN_MOOV_BOX_SIZE = 3 * 1024;  // 3 KB
    static const int64_t MAX_MOOV_BOX_SIZE = (180 * 3000000 * 6LL / 8000);
    int64_t size = MIN_MOOV_BOX_SIZE;
    int32_t factor = mUse32BitOffset? 1: 2;

    // Max file size limit is set
    if (mMaxFileSizeLimitBytes != 0 && mIsFileSizeLimitExplicitlyRequested) {