Loading services/audioflinger/AudioFlinger.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -622,15 +622,17 @@ sp<IAudioTrack> AudioFlinger::createTrack( } if (lStatus == NO_ERROR) { trackHandle = new TrackHandle(track); } else { // remove local strong reference to Client before deleting the Track so that the Client // destructor is called by the TrackBase destructor with mLock held if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the Track so that the // Client destructor is called by the TrackBase destructor with mLock held client.clear(); track.clear(); goto Exit; } // return handle to client trackHandle = new TrackHandle(track); Exit: *status = lStatus; return trackHandle; Loading services/audioflinger/Tracks.cpp +36 −35 Original line number Diff line number Diff line Loading @@ -350,7 +350,10 @@ AudioFlinger::PlaybackThread::Track::Track( mResumeToStopping(false), mFlushHwPending(false) { if (mCblk != NULL) { if (mCblk == NULL) { return; } if (sharedBuffer == 0) { mAudioTrackServerProxy = new AudioTrackServerProxy(mCblk, mBuffer, frameCount, mFrameSize); Loading @@ -359,7 +362,7 @@ AudioFlinger::PlaybackThread::Track::Track( mFrameSize); } mServerProxy = mAudioTrackServerProxy; // to avoid leaking a track name, do not allocate one unless there is an mCblk mName = thread->getTrackName_l(channelMask, sessionId); if (mName < 0) { ALOGE("no more track names available"); Loading @@ -381,9 +384,6 @@ AudioFlinger::PlaybackThread::Track::Track( thread->mFastTrackAvailMask &= ~(1 << i); } } ALOGV("Track constructor name %d, calling pid %d", mName, IPCThreadState::self()->getCallingPid()); } AudioFlinger::PlaybackThread::Track::~Track() { Loading Loading @@ -1789,11 +1789,12 @@ AudioFlinger::RecordThread::RecordTrack::RecordTrack( // See real initialization of mRsmpInFront at RecordThread::start() mRsmpInUnrel(0), mRsmpInFront(0), mFramesToDrop(0), mResamplerBufferProvider(NULL) { ALOGV("RecordTrack constructor"); if (mCblk != NULL) { mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount, mFrameSize); if (mCblk == NULL) { return; } mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount, mFrameSize); uint32_t channelCount = popcount(channelMask); // FIXME I don't understand either of the channel count checks if (thread->mSampleRate != sampleRate && thread->mChannelCount <= FCC_2 && Loading Loading
services/audioflinger/AudioFlinger.cpp +7 −5 Original line number Diff line number Diff line Loading @@ -622,15 +622,17 @@ sp<IAudioTrack> AudioFlinger::createTrack( } if (lStatus == NO_ERROR) { trackHandle = new TrackHandle(track); } else { // remove local strong reference to Client before deleting the Track so that the Client // destructor is called by the TrackBase destructor with mLock held if (lStatus != NO_ERROR) { // remove local strong reference to Client before deleting the Track so that the // Client destructor is called by the TrackBase destructor with mLock held client.clear(); track.clear(); goto Exit; } // return handle to client trackHandle = new TrackHandle(track); Exit: *status = lStatus; return trackHandle; Loading
services/audioflinger/Tracks.cpp +36 −35 Original line number Diff line number Diff line Loading @@ -350,7 +350,10 @@ AudioFlinger::PlaybackThread::Track::Track( mResumeToStopping(false), mFlushHwPending(false) { if (mCblk != NULL) { if (mCblk == NULL) { return; } if (sharedBuffer == 0) { mAudioTrackServerProxy = new AudioTrackServerProxy(mCblk, mBuffer, frameCount, mFrameSize); Loading @@ -359,7 +362,7 @@ AudioFlinger::PlaybackThread::Track::Track( mFrameSize); } mServerProxy = mAudioTrackServerProxy; // to avoid leaking a track name, do not allocate one unless there is an mCblk mName = thread->getTrackName_l(channelMask, sessionId); if (mName < 0) { ALOGE("no more track names available"); Loading @@ -381,9 +384,6 @@ AudioFlinger::PlaybackThread::Track::Track( thread->mFastTrackAvailMask &= ~(1 << i); } } ALOGV("Track constructor name %d, calling pid %d", mName, IPCThreadState::self()->getCallingPid()); } AudioFlinger::PlaybackThread::Track::~Track() { Loading Loading @@ -1789,11 +1789,12 @@ AudioFlinger::RecordThread::RecordTrack::RecordTrack( // See real initialization of mRsmpInFront at RecordThread::start() mRsmpInUnrel(0), mRsmpInFront(0), mFramesToDrop(0), mResamplerBufferProvider(NULL) { ALOGV("RecordTrack constructor"); if (mCblk != NULL) { mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount, mFrameSize); if (mCblk == NULL) { return; } mServerProxy = new AudioRecordServerProxy(mCblk, mBuffer, frameCount, mFrameSize); uint32_t channelCount = popcount(channelMask); // FIXME I don't understand either of the channel count checks if (thread->mSampleRate != sampleRate && thread->mChannelCount <= FCC_2 && Loading