Bug 1035531 - Discard buffer instead of assert if camera media frame comes in early. r=mikeh

This commit is contained in:
Andrew Osmond 2014-07-09 07:04:00 +02:00
parent 9543d31f31
commit 5dedebb8ed

View File

@ -709,7 +709,12 @@ void GonkCameraSource::dataCallbackTimestamp(int64_t timestampUs,
}
if (mNumFramesReceived > 0) {
CHECK(timestampUs > mLastFrameTimestampUs);
if (timestampUs <= mLastFrameTimestampUs) {
CS_LOGE("Drop frame at %lld us, before last at %lld us",
timestampUs, mLastFrameTimestampUs);
releaseOneRecordingFrame(data);
return;
}
if (timestampUs - mLastFrameTimestampUs > mGlitchDurationThresholdUs) {
++mNumGlitches;
}