diff options
author | Andy Hung <hunga@google.com> | 2015-02-26 23:39:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-26 23:39:14 +0000 |
commit | 7841f704fee0e5acd45fa6e47a336120c3cad42c (patch) | |
tree | c75096dc548d0bdb9eec94663e08dc59fe287fc5 /services/audioflinger | |
parent | 364b2600670e178931f0e88dbffb4f1f3dccc4ea (diff) | |
parent | 5bedff60b2facaa1ec5b9433647ebf1504f065ca (diff) | |
download | frameworks_av-7841f704fee0e5acd45fa6e47a336120c3cad42c.zip frameworks_av-7841f704fee0e5acd45fa6e47a336120c3cad42c.tar.gz frameworks_av-7841f704fee0e5acd45fa6e47a336120c3cad42c.tar.bz2 |
Merge "Do not pre-fill OutputTrack buffer for duplicating thread"
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Tracks.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index 78cec31..fa0beaa 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -1722,28 +1722,7 @@ bool AudioFlinger::PlaybackThread::OutputTrack::write(void* data, uint32_t frame uint32_t waitTimeLeftMs = mSourceThread->waitTimeMs(); if (!mActive && frames != 0) { - start(); - sp<ThreadBase> thread = mThread.promote(); - if (thread != 0) { - MixerThread *mixerThread = (MixerThread *)thread.get(); - if (mFrameCount > frames) { - // For the first write after being inactive, ensure that we have - // enough frames to fill mFrameCount (which should be multiples of - // the minimum buffer requirements of the downstream MixerThread). - // This provides enough frames for the downstream mixer to begin - // (see AudioFlinger::PlaybackThread::Track::isReady()). - if (mBufferQueue.size() < kMaxOverFlowBuffers) { - uint32_t startFrames = (mFrameCount - frames); - pInBuffer = new Buffer; - pInBuffer->mBuffer = calloc(1, startFrames * mFrameSize); - pInBuffer->frameCount = startFrames; - pInBuffer->raw = pInBuffer->mBuffer; - mBufferQueue.add(pInBuffer); - } else { - ALOGW("OutputTrack::write() %p no more buffers in queue", this); - } - } - } + (void) start(); } while (waitTimeLeftMs) { |