diff options
author | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-10-01 16:03:44 -0700 |
commit | af5dd7753e62353411cf0daf3b513c38818e9662 (patch) | |
tree | e935f45f925c4ce6d35d16764e2d40db69cc954a /media/libstagefright/AudioSource.cpp | |
parent | 0868deae404604b577892413c128d55a2bafc56e (diff) | |
download | frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.zip frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.tar.gz frameworks_av-af5dd7753e62353411cf0daf3b513c38818e9662.tar.bz2 |
ALooper::GetNowUs() now relies on systemTime instead of gettimeofday.
Change-Id: Ia31eb0940b02581327a8bf51af6df135f9ab6de3
related-to-bug: 7266324
Diffstat (limited to 'media/libstagefright/AudioSource.cpp')
-rw-r--r-- | media/libstagefright/AudioSource.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 3248dbc..861aebe 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -54,9 +54,7 @@ AudioSource::AudioSource( mSampleRate(sampleRate), mPrevSampleTimeUs(0), mNumFramesReceived(0), - mNumClientOwnedBuffers(0), - mUseLooperTime(false) { - + mNumClientOwnedBuffers(0) { ALOGV("sampleRate: %d, channelCount: %d", sampleRate, channelCount); CHECK(channelCount == 1 || channelCount == 2); @@ -102,12 +100,6 @@ status_t AudioSource::initCheck() const { return mInitCheck; } -void AudioSource::setUseLooperTime(bool useLooperTime) { - CHECK(!mStarted); - - mUseLooperTime = useLooperTime; -} - status_t AudioSource::start(MetaData *params) { Mutex::Autolock autoLock(mLock); if (mStarted) { @@ -280,8 +272,7 @@ void AudioSource::signalBufferReturned(MediaBuffer *buffer) { } status_t AudioSource::dataCallback(const AudioRecord::Buffer& audioBuffer) { - int64_t timeUs = - mUseLooperTime ? ALooper::GetNowUs() : (systemTime() / 1000ll); + int64_t timeUs = systemTime() / 1000ll; ALOGV("dataCallbackTimestamp: %lld us", timeUs); Mutex::Autolock autoLock(mLock); @@ -300,9 +291,7 @@ status_t AudioSource::dataCallback(const AudioRecord::Buffer& audioBuffer) { if (mNumFramesReceived == 0 && mPrevSampleTimeUs == 0) { mInitialReadTimeUs = timeUs; // Initial delay - if (mUseLooperTime) { - mStartTimeUs = timeUs; - } else if (mStartTimeUs > 0) { + if (mStartTimeUs > 0) { mStartTimeUs = timeUs - mStartTimeUs; } else { // Assume latency is constant. |