diff options
author | Wei Jia <wjia@google.com> | 2015-08-11 02:35:24 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-11 02:35:24 +0000 |
commit | a3474637353226e0649016e1a0ec0e5ca4660918 (patch) | |
tree | 02f5377820239041efcbf9e0ca6be7e4a92867b7 | |
parent | 15054fac95cd9e1c6b3db52f215f284f1a3658c8 (diff) | |
parent | 9195d57f3e6cf5339531944469293e1188a7947f (diff) | |
download | frameworks_av-a3474637353226e0649016e1a0ec0e5ca4660918.zip frameworks_av-a3474637353226e0649016e1a0ec0e5ca4660918.tar.gz frameworks_av-a3474637353226e0649016e1a0ec0e5ca4660918.tar.bz2 |
am 9195d57f: Merge "NuPlayer: set video surface directly when NuPlayer has not started yet." into mnc-dev
* commit '9195d57f3e6cf5339531944469293e1188a7947f':
NuPlayer: set video surface directly when NuPlayer has not started yet.
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 214315f..77b9799 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -632,10 +632,13 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { ALOGD("onSetVideoSurface(%p, %s video decoder)", surface.get(), - (mSource != NULL && mSource->getFormat(false /* audio */) != NULL + (mSource != NULL && mStarted && mSource->getFormat(false /* audio */) != NULL && mVideoDecoder != NULL) ? "have" : "no"); - if (mSource == NULL || mSource->getFormat(false /* audio */) == NULL + // Need to check mStarted before calling mSource->getFormat because NuPlayer might + // be in preparing state and it could take long time. + // When mStarted is true, mSource must have been set. + if (mSource == NULL || !mStarted || mSource->getFormat(false /* audio */) == NULL // NOTE: mVideoDecoder's mSurface is always non-null || (mVideoDecoder != NULL && mVideoDecoder->setVideoSurface(surface) == OK)) { performSetSurface(surface); |