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

Commit d2bb2f98 authored by Praveen Chavan's avatar Praveen Chavan Committed by Gerrit - the friendly Code Review server
Browse files

StagefrightRecorder: force 64-bit file-offsets for files > 4GB

Enable recording files larger than 4GB by forcing 64-bit file-offsets
in the writer, if application indicates max-file-size greater than 4GB.

Change-Id: Id1af5bdf3543af156e6d3d80be2e00c7df3b4134
CRs-Fixed: 807377
parent 0c52765e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@

namespace android {

static const int64_t kMax32BitFileSize = 0x00ffffffffLL; // 4GB

// To collect the encoder usage for the battery app
static void addBatteryData(uint32_t params) {
    sp<IBinder> binder =
@@ -475,6 +477,10 @@ status_t StagefrightRecorder::setParamMaxFileSizeBytes(int64_t bytes) {
    }

    mMaxFileSizeBytes = bytes;

    // If requested size is >4GB, force 64-bit offsets
    mUse64BitFileOffset |= (bytes >= kMax32BitFileSize);

    return OK;
}