From 79e23b41fad961008bfde6e26b3c6f86878ca69d Mon Sep 17 00:00:00 2001 From: James Dong Date: Sat, 11 Dec 2010 10:43:41 -0800 Subject: Revert "Allows the authoring engine to skip frame." o Skipping frames could lead to a lot of issues such as I frames is lost etc. It is not being used anyway. This reverts commit 53d4e0d58e2d5c18f6e026c705af833b9bdd7aba. Conflicts: media/libstagefright/AudioSource.cpp media/libstagefright/CameraSource.cpp Change-Id: I3abba1647de48db25bdc369066eb2a7ae4dedec2 --- media/libstagefright/AudioSource.cpp | 46 +----------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'media/libstagefright/AudioSource.cpp') diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 29f16d8..235d752 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -140,38 +140,6 @@ sp AudioSource::getFormat() { return meta; } -/* - * Returns -1 if frame skipping request is too long. - * Returns 0 if there is no need to skip frames. - * Returns 1 if we need to skip frames. - */ -static int skipFrame(int64_t timestampUs, - const MediaSource::ReadOptions *options) { - - int64_t skipFrameUs; - if (!options || !options->getSkipFrame(&skipFrameUs)) { - return 0; - } - - if (skipFrameUs <= timestampUs) { - return 0; - } - - // Safe guard against the abuse of the kSkipFrame_Option. - if (skipFrameUs - timestampUs >= 1E6) { - LOGE("Frame skipping requested is way too long: %lld us", - skipFrameUs - timestampUs); - - return -1; - } - - LOGV("skipFrame: %lld us > timestamp: %lld us", - skipFrameUs, timestampUs); - - return 1; - -} - void AudioSource::rampVolume( int32_t startFrame, int32_t rampDurationFrames, uint8_t *data, size_t bytes) { @@ -218,7 +186,7 @@ status_t AudioSource::read( CHECK_EQ(mGroup->acquire_buffer(&buffer), OK); int err = 0; - while (mStarted) { + if (mStarted) { uint32_t numFramesRecorded; mRecord->getPosition(&numFramesRecorded); @@ -268,12 +236,6 @@ status_t AudioSource::read( if (mCollectStats) { mTotalLostFrames += (numLostBytes >> 1); } - if ((err = skipFrame(timestampUs, options)) == -1) { - buffer->release(); - return UNKNOWN_ERROR; - } else if (err != 0) { - continue; - } memset(buffer->data(), 0, numLostBytes); buffer->set_range(0, numLostBytes); if (numFramesRecorded == 0) { @@ -294,12 +256,6 @@ status_t AudioSource::read( int64_t recordDurationUs = (1000000LL * n >> 1) / sampleRate; timestampUs += recordDurationUs; - if ((err = skipFrame(timestampUs, options)) == -1) { - buffer->release(); - return UNKNOWN_ERROR; - } else if (err != 0) { - continue; - } if (mPrevSampleTimeUs - mStartTimeUs < kAutoRampStartUs) { // Mute the initial video recording signal -- cgit v1.1