Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3474637 authored by Wei Jia's avatar Wei Jia Committed by Android Git Automerger
Browse files

am 9195d57f: Merge "NuPlayer: set video surface directly when NuPlayer has not...

am 9195d57f: Merge "NuPlayer: set video surface directly when NuPlayer has not started yet." into mnc-dev

* commit '9195d57f':
  NuPlayer: set video surface directly when NuPlayer has not started yet.
parents 15054fac 9195d57f
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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);