OSDN Git Service

resolved conflicts for merge of 3d630e86 to master
authorAndreas Huber <andih@google.com>
Wed, 30 Nov 2011 17:53:40 +0000 (09:53 -0800)
committerAndreas Huber <andih@google.com>
Wed, 30 Nov 2011 17:53:40 +0000 (09:53 -0800)
Change-Id: I9eb7b7c1668b5f0de85ec8b1e9257cf1ec4d8b9e

1  2 
media/libmediaplayerservice/nuplayer/NuPlayer.cpp
media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp

@@@ -461,13 -461,26 +461,26 @@@ void NuPlayer::onMessageReceived(const 
  
          case kWhatReset:
          {
 -            LOGV("kWhatReset");
 +            ALOGV("kWhatReset");
  
+             if (mRenderer != NULL) {
+                 // There's an edge case where the renderer owns all output
+                 // buffers and is paused, therefore the decoder will not read
+                 // more input data and will never encounter the matching
+                 // discontinuity. To avoid this, we resume the renderer.
+                 if (mFlushingAudio == AWAITING_DISCONTINUITY
+                         || mFlushingVideo == AWAITING_DISCONTINUITY) {
+                     mRenderer->resume();
+                 }
+             }
              if (mFlushingAudio != NONE || mFlushingVideo != NONE) {
                  // We're currently flushing, postpone the reset until that's
                  // completed.
  
-                 ALOGV("postponing reset");
 -                LOGV("postponing reset mFlushingAudio=%d, mFlushingVideo=%d",
 -                        mFlushingAudio, mFlushingVideo);
++                ALOGV("postponing reset mFlushingAudio=%d, mFlushingVideo=%d",
++                      mFlushingAudio, mFlushingVideo);
  
                  mResetPostponed = true;
                  break;
@@@ -628,6 -628,9 +628,9 @@@ void NuPlayer::Renderer::onPause() 
          mAudioSink->pause();
      }
  
 -    LOGV("now paused audio queue has %d entries, video has %d entries",
 -         mAudioQueue.size(), mVideoQueue.size());
++    ALOGV("now paused audio queue has %d entries, video has %d entries",
++          mAudioQueue.size(), mVideoQueue.size());
      mPaused = true;
  }