Loading media/libstagefright/codecs/aacenc/AACEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -209,7 +209,7 @@ status_t AACEncoder::read( CHECK_EQ(mBufferGroup->acquire_buffer(&buffer), OK); uint8_t *outPtr = (uint8_t *)buffer->data(); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; if (mFrameCount == 0) { memcpy(outPtr, mAudioSpecificConfigData, 2); Loading Loading @@ -240,8 +240,9 @@ status_t AACEncoder::read( CHECK_EQ(align, 0); int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -298,7 +299,7 @@ status_t AACEncoder::read( int64_t mediaTimeUs = ((mFrameCount - 1) * 1000000LL * kNumSamplesPerFrame) / mSampleRate; buffer->meta_data()->setInt64(kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } ++mFrameCount; Loading media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ status_t AMRNBEncoder::read( ReadOptions::SeekMode mode; CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &mode)); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; while (mNumInputSamples < kNumSamplesPerFrame) { if (mInputBuffer == NULL) { Loading @@ -171,8 +171,9 @@ status_t AMRNBEncoder::read( readFromSource = true; int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -227,7 +228,7 @@ status_t AMRNBEncoder::read( buffer->meta_data()->setInt64( kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } Loading media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ status_t AMRWBEncoder::read( ReadOptions::SeekMode mode; CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &mode)); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; while (mNumInputSamples < kNumSamplesPerFrame) { if (mInputBuffer == NULL) { Loading @@ -221,8 +221,9 @@ status_t AMRWBEncoder::read( CHECK_EQ(align, 0); int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -285,7 +286,7 @@ status_t AMRWBEncoder::read( int64_t mediaTimeUs = mNumFramesOutput * 20000LL; buffer->meta_data()->setInt64(kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } Loading Loading
media/libstagefright/codecs/aacenc/AACEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -209,7 +209,7 @@ status_t AACEncoder::read( CHECK_EQ(mBufferGroup->acquire_buffer(&buffer), OK); uint8_t *outPtr = (uint8_t *)buffer->data(); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; if (mFrameCount == 0) { memcpy(outPtr, mAudioSpecificConfigData, 2); Loading Loading @@ -240,8 +240,9 @@ status_t AACEncoder::read( CHECK_EQ(align, 0); int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -298,7 +299,7 @@ status_t AACEncoder::read( int64_t mediaTimeUs = ((mFrameCount - 1) * 1000000LL * kNumSamplesPerFrame) / mSampleRate; buffer->meta_data()->setInt64(kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } ++mFrameCount; Loading
media/libstagefright/codecs/amrnb/enc/AMRNBEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ status_t AMRNBEncoder::read( ReadOptions::SeekMode mode; CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &mode)); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; while (mNumInputSamples < kNumSamplesPerFrame) { if (mInputBuffer == NULL) { Loading @@ -171,8 +171,9 @@ status_t AMRNBEncoder::read( readFromSource = true; int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -227,7 +228,7 @@ status_t AMRNBEncoder::read( buffer->meta_data()->setInt64( kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } Loading
media/libstagefright/codecs/amrwbenc/AMRWBEncoder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -199,7 +199,7 @@ status_t AMRWBEncoder::read( ReadOptions::SeekMode mode; CHECK(options == NULL || !options->getSeekTo(&seekTimeUs, &mode)); bool readFromSource = false; int64_t wallClockTimeUs = 0; int64_t wallClockTimeUs = -1; while (mNumInputSamples < kNumSamplesPerFrame) { if (mInputBuffer == NULL) { Loading @@ -221,8 +221,9 @@ status_t AMRWBEncoder::read( CHECK_EQ(align, 0); int64_t timeUs; CHECK(mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)); if (mInputBuffer->meta_data()->findInt64(kKeyDriftTime, &timeUs)) { wallClockTimeUs = timeUs; } if (mInputBuffer->meta_data()->findInt64(kKeyTime, &timeUs)) { mAnchorTimeUs = timeUs; } Loading Loading @@ -285,7 +286,7 @@ status_t AMRWBEncoder::read( int64_t mediaTimeUs = mNumFramesOutput * 20000LL; buffer->meta_data()->setInt64(kKeyTime, mAnchorTimeUs + mediaTimeUs); if (readFromSource) { if (readFromSource && wallClockTimeUs != -1) { buffer->meta_data()->setInt64(kKeyDriftTime, mediaTimeUs - wallClockTimeUs); } Loading