From acd234bba9f048971d66890009eeff9a8db94be3 Mon Sep 17 00:00:00 2001 From: James Dong Date: Tue, 30 Nov 2010 18:18:08 -0800 Subject: Be conservative in estimating the file size limit. bug - 3045580 Change-Id: Ifdffa354b9433639c3f246a0eb581ef14af1e797 --- media/libstagefright/MPEG4Writer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'media/libstagefright') 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() { -- cgit v1.1