diff options
| author | 2011-06-03 17:21:16 -0700 | |
|---|---|---|
| committer | 2011-06-03 17:21:16 -0700 | |
| commit | 86f8b98e763b34e6a74e81bc9faa3a875c16e18c (patch) | |
| tree | d950322c213599c670bab032d290fd5c5f74ea21 | |
| parent | 475a05234120c8247fe5f722f8843a06102ad2d7 (diff) | |
Add timestamp and data pointer checks in CameraSource
Change-Id: I99e188f631df2257813aa7ec657d6ecfc8859d9e
| -rw-r--r-- | media/libstagefright/CameraSource.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index a1f04d3fa1b0..61bb2a89b44f 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -701,12 +701,11 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs, return; } - if (mNumFramesReceived > 0 && - timestampUs - mLastFrameTimestampUs > mGlitchDurationThresholdUs) { - if (mNumGlitches % 10 == 0) { // Don't spam the log - LOGV("Long delay detected in video recording"); + if (mNumFramesReceived > 0) { + CHECK(timestampUs > mLastFrameTimestampUs); + if (timestampUs - mLastFrameTimestampUs > mGlitchDurationThresholdUs) { + ++mNumGlitches; } - ++mNumGlitches; } // May need to skip frame or modify timestamp. Currently implemented @@ -732,6 +731,7 @@ void CameraSource::dataCallbackTimestamp(int64_t timestampUs, } ++mNumFramesReceived; + CHECK(data != NULL && data->size() > 0); mFramesReceived.push_back(data); int64_t timeUs = mStartTimeUs + (timestampUs - mFirstFrameTimeUs); mFrameTimes.push_back(timeUs); |