diff options
Diffstat (limited to 'media/libmediaplayerservice')
-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 8f45491f..daf60f6e 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -258,7 +258,9 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { ALOGV("scanning sources haveAudio=%d, haveVideo=%d", mAudioDecoder != NULL, mVideoDecoder != NULL); - instantiateDecoder(false, &mVideoDecoder); + if (mNativeWindow != NULL) { + instantiateDecoder(false, &mVideoDecoder); + } if (mAudioSink != NULL) { instantiateDecoder(true, &mAudioDecoder); @@ -279,7 +281,8 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) { break; } - if (mAudioDecoder == NULL || mVideoDecoder == NULL) { + if (mAudioDecoder == NULL && mAudioSink != NULL || + mVideoDecoder == NULL && mNativeWindow != NULL) { msg->post(100000ll); mScanSourcesPending = true; } |