summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-11-30 18:18:08 -0800
committerJames Dong <jdong@google.com>2010-11-30 18:18:08 -0800
commitacd234bba9f048971d66890009eeff9a8db94be3 (patch)
treee7cadaf62d1afeb15a5e776737c3985b08ad7fc1 /media/libstagefright/MPEG4Writer.cpp
parent03b55cc9d3529995925c8df0d4a35269e591188c (diff)
downloadframeworks_av-acd234bba9f048971d66890009eeff9a8db94be3.zip
frameworks_av-acd234bba9f048971d66890009eeff9a8db94be3.tar.gz
frameworks_av-acd234bba9f048971d66890009eeff9a8db94be3.tar.bz2
Be conservative in estimating the file size limit.
bug - 3045580 Change-Id: Ifdffa354b9433639c3f246a0eb581ef14af1e797
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r--media/libstagefright/MPEG4Writer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index cbb1604..7eb7d46 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -863,7 +863,10 @@ bool MPEG4Writer::exceedsFileSizeLimit() {
nTotalBytesEstimate += (*it)->getEstimatedTrackSizeBytes();
}
- return (nTotalBytesEstimate >= mMaxFileSizeLimitBytes);
+ // Be conservative in the estimate: do not exceed 95% of
+ // the target file limit. For small target file size limit, though,
+ // this will not help.
+ return (nTotalBytesEstimate >= (95 * mMaxFileSizeLimitBytes) / 100);
}
bool MPEG4Writer::exceedsFileDurationLimit() {