diff options
author | Rachad <rachad@google.com> | 2014-02-10 16:54:46 -0800 |
---|---|---|
committer | Vineeta Srivastava <vsrivastava@google.com> | 2014-03-21 16:36:35 +0000 |
commit | f622e2c78407b50806a53a06a89b2b6546420f55 (patch) | |
tree | 0a4e6bc97cccf6a40d76ef15e88e1a62b8a6e3b5 | |
parent | a577eefbaca24d1b9ac947daca54be1992888748 (diff) | |
download | frameworks_av-f622e2c78407b50806a53a06a89b2b6546420f55.zip frameworks_av-f622e2c78407b50806a53a06a89b2b6546420f55.tar.gz frameworks_av-f622e2c78407b50806a53a06a89b2b6546420f55.tar.bz2 |
Increased recorded MP4 max file size to 4GB
(more precisely 2^32-1 bytes -- FAT32 max file size)
bug: 11039801
Change-Id: I6169f798c59d123d02d5fd7afa3b9e645ebdb598
(cherry picked from commit 1f1f2b1678fd0d038dfc501252dd2b65ecf10cae)
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index a0f17b5..42885dd 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -43,7 +43,9 @@ namespace android { static const int64_t kMinStreamableFileSizeInBytes = 5 * 1024 * 1024; -static const int64_t kMax32BitFileSize = 0x007fffffffLL; +static const int64_t kMax32BitFileSize = 0x00ffffffffLL; // 2^32-1 : max FAT32 + // filesystem file size + // used by most SD cards static const uint8_t kNalUnitTypeSeqParamSet = 0x07; static const uint8_t kNalUnitTypePicParamSet = 0x08; static const int64_t kInitialDelayTimeUs = 700000LL; @@ -860,11 +862,11 @@ status_t MPEG4Writer::reset() { // Fix up the size of the 'mdat' chunk. if (mUse32BitOffset) { lseek64(mFd, mMdatOffset, SEEK_SET); - int32_t size = htonl(static_cast<int32_t>(mOffset - mMdatOffset)); + uint32_t size = htonl(static_cast<uint32_t>(mOffset - mMdatOffset)); ::write(mFd, &size, 4); } else { lseek64(mFd, mMdatOffset + 8, SEEK_SET); - int64_t size = mOffset - mMdatOffset; + uint64_t size = mOffset - mMdatOffset; size = hton64(size); ::write(mFd, &size, 8); } |