@@ -2043,10 +2043,6 @@ if (mType == MIXER) {
20432043
20442044 processConfigEvents ();
20452045
2046- if (mType == DIRECT) {
2047- activeTrack.clear ();
2048- }
2049-
20502046 mixerStatus = MIXER_IDLE;
20512047 { // scope for mLock
20522048
@@ -2138,10 +2134,6 @@ if (mType == MIXER) {
21382134 lockEffectChains_l (effectChains);
21392135 }
21402136
2141- if (mType == DIRECT) {
2142- // For DirectOutputThread, this test is equivalent to "activeTrack != 0"
2143- }
2144-
21452137 if (CC_LIKELY (mixerStatus == MIXER_TRACKS_READY)) {
21462138 threadLoop_mix ();
21472139 } else {
@@ -2196,10 +2188,6 @@ if (mType == MIXER) {
21962188 // same lock.
21972189 tracksToRemove.clear ();
21982190
2199- // FIXME merge these
2200- if (mType == DIRECT) {
2201- activeTrack.clear ();
2202- }
22032191 // FIXME I don't understand the need for this here;
22042192 // it was in the original code but maybe the
22052193 // assignment in saveOutputTracks() makes this unnecessary?
@@ -2918,7 +2906,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::DirectOutputThread::prep
29182906
29192907 // reset retry count
29202908 track->mRetryCount = kMaxTrackRetriesDirect ;
2921- activeTrack = t;
2909+ mActiveTrack = t;
29222910 mixerStatus_ = MIXER_TRACKS_READY;
29232911 } else {
29242912 // ALOGV("track %d u=%08x, s=%08x [NOT READY]", track->name(), cblk->user, cblk->server);
@@ -2968,18 +2956,19 @@ void AudioFlinger::DirectOutputThread::threadLoop_mix()
29682956 // output audio to hardware
29692957 while (frameCount) {
29702958 buffer.frameCount = frameCount;
2971- activeTrack ->getNextBuffer (&buffer);
2959+ mActiveTrack ->getNextBuffer (&buffer);
29722960 if (CC_UNLIKELY (buffer.raw == NULL )) {
29732961 memset (curBuf, 0 , frameCount * mFrameSize );
29742962 break ;
29752963 }
29762964 memcpy (curBuf, buffer.raw , buffer.frameCount * mFrameSize );
29772965 frameCount -= buffer.frameCount ;
29782966 curBuf += buffer.frameCount * mFrameSize ;
2979- activeTrack ->releaseBuffer (&buffer);
2967+ mActiveTrack ->releaseBuffer (&buffer);
29802968 }
29812969 sleepTime = 0 ;
29822970 standbyTime = systemTime () + standbyDelay;
2971+ mActiveTrack .clear ();
29832972 applyVolume ();
29842973}
29852974
0 commit comments