From 5d246efa220a7c7b22e490576c488b3853c664dd Mon Sep 17 00:00:00 2001 From: Haynes Mathew George Date: Mon, 9 Jul 2012 10:36:57 -0700 Subject: NuPlayer: Prevents creation of Video Decoder when we use Music Player - Prevents instantion of Video Decoder when we use applications like Music Player which do not support Video Playback - Adds a check to prevent scanning for sources when it is either an Audio only clip or a video only clip or an AV clip played with a Music Player. Change-Id: I74dd9bc53e54fd4f3682536c987289ac252690b0 Signed-off-by: Arvind Thatikonda --- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'media/libmediaplayerservice/nuplayer') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 86e122f..bda8123 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -258,7 +258,9 @@ void NuPlayer::onMessageReceived(const sp &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 &msg) { break; } - if (mAudioDecoder == NULL || mVideoDecoder == NULL) { + if (mAudioDecoder == NULL && mAudioSink != NULL || + mVideoDecoder == NULL && mNativeWindow != NULL) { msg->post(100000ll); mScanSourcesPending = true; } -- cgit v1.1