OSDN Git Service

resolved conflicts for merge of 05683c85 to master
authorEric Laurent <elaurent@google.com>
Thu, 19 Jan 2012 18:00:02 +0000 (10:00 -0800)
committerEric Laurent <elaurent@google.com>
Thu, 19 Jan 2012 18:00:02 +0000 (10:00 -0800)
Change-Id: I7846b7da8c5813b7a9b1f3f71aede0229689ff0d

1  2 
services/audioflinger/AudioFlinger.cpp
services/audioflinger/AudioFlinger.h

@@@ -1849,7 -1832,7 +1849,7 @@@ uint32_t AudioFlinger::PlaybackThread::
  
  AudioFlinger::MixerThread::MixerThread(const sp<AudioFlinger>& audioFlinger, AudioStreamOut* output, int id, uint32_t device)
      :   PlaybackThread(audioFlinger, output, id, device),
-         mAudioMixer(NULL)
 -        mAudioMixer(0), mPrevMixerStatus(MIXER_IDLE)
++        mAudioMixer(NULL), mPrevMixerStatus(MIXER_IDLE)
  {
      mType = ThreadBase::MIXER;
      mAudioMixer = new AudioMixer(mFrameCount, mSampleRate);
@@@ -1957,12 -1940,13 +1957,13 @@@ bool AudioFlinger::MixerThread::threadL
  
                      releaseWakeLock_l();
                      // wait until we have something to do...
 -                    LOGV("MixerThread %p TID %d going to sleep\n", this, gettid());
 +                    ALOGV("MixerThread %p TID %d going to sleep\n", this, gettid());
                      mWaitWorkCV.wait(mLock);
 -                    LOGV("MixerThread %p TID %d waking up\n", this, gettid());
 +                    ALOGV("MixerThread %p TID %d waking up\n", this, gettid());
                      acquireWakeLock_l();
  
 -                    if (mMasterMute == false) {
+                     mPrevMixerStatus = MIXER_IDLE;
 +                    if (!mMasterMute) {
                          char value[PROPERTY_VALUE_MAX];
                          property_get("ro.audio.silent", value, "0");
                          if (atoi(value)) {
@@@ -2274,9 -2230,15 +2275,15 @@@ uint32_t AudioFlinger::MixerThread::pre
  
              // reset retry count
              track->mRetryCount = kMaxTrackRetries;
-             mixerStatus = MIXER_TRACKS_READY;
+             // If one track is ready, set the mixer ready if:
+             //  - the mixer was not ready during previous round OR
+             //  - no other track is not ready
+             if (mPrevMixerStatus != MIXER_TRACKS_READY ||
+                     mixerStatus != MIXER_TRACKS_ENABLED) {
+                 mixerStatus = MIXER_TRACKS_READY;
+             }
          } else {
 -            //LOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", track->name(), cblk->user, cblk->server, this);
 +            //ALOGV("track %d u=%08x, s=%08x [NOT READY] on thread %p", name, cblk->user, cblk->server, this);
              if (track->isStopped()) {
                  track->reset();
              }
@@@ -3049,12 -3023,13 +3061,13 @@@ bool AudioFlinger::DuplicatingThread::t
                      if (exitPending()) break;
  
                      releaseWakeLock_l();
 -                    LOGV("DuplicatingThread %p TID %d going to sleep\n", this, gettid());
 +                    ALOGV("DuplicatingThread %p TID %d going to sleep\n", this, gettid());
                      mWaitWorkCV.wait(mLock);
 -                    LOGV("DuplicatingThread %p TID %d waking up\n", this, gettid());
 +                    ALOGV("DuplicatingThread %p TID %d waking up\n", this, gettid());
                      acquireWakeLock_l();
  
 -                    if (mMasterMute == false) {
+                     mPrevMixerStatus = MIXER_IDLE;
 +                    if (!mMasterMute) {
                          char value[PROPERTY_VALUE_MAX];
                          property_get("ro.audio.silent", value, "0");
                          if (atoi(value)) {
Simple merge