am 300b0b7e: Merge "setParamMaxFileDurationUs should allow zero time input as per API of setMaxDuration." into gingerbread

Merge commit '300b0b7e2b8f0ab922e4a83755ae999da191894e' into gingerbread-plus-aosp

* commit '300b0b7e2b8f0ab922e4a83755ae999da191894e':
  setParamMaxFileDurationUs should allow zero time input as per API of setMaxDuration.
This commit is contained in:
Nipun Kwatra
2010-08-20 14:18:08 -07:00
committed by Android Git Automerger

View File

@@ -341,10 +341,14 @@ status_t StagefrightRecorder::setParamVideoEncodingBitRate(int32_t bitRate) {
status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) { status_t StagefrightRecorder::setParamMaxFileDurationUs(int64_t timeUs) {
LOGV("setParamMaxFileDurationUs: %lld us", timeUs); LOGV("setParamMaxFileDurationUs: %lld us", timeUs);
if (timeUs <= 100000LL) { // XXX: 100 milli-seconds if (timeUs <= 0) {
LOGW("Max file duration is not positive: %lld us. Disabling duration limit.", timeUs);
timeUs = 0; // Disable the duration limit for zero or negative values.
} else if (timeUs <= 100000LL) { // XXX: 100 milli-seconds
LOGE("Max file duration is too short: %lld us", timeUs); LOGE("Max file duration is too short: %lld us", timeUs);
return BAD_VALUE; return BAD_VALUE;
} }
mMaxFileDurationUs = timeUs; mMaxFileDurationUs = timeUs;
return OK; return OK;
} }