summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2012-07-09 10:36:57 -0700
committerIliyan Malchev <malchev@google.com>2012-07-25 01:28:36 -0700
commit5d246efa220a7c7b22e490576c488b3853c664dd (patch)
tree8258668e5e235b67d51d8f4554e77f8c2434fe2c /media/libmediaplayerservice/nuplayer
parent45dfb6ae94b33eea04d74afa378c1664e884f09a (diff)
downloadframeworks_av-5d246efa220a7c7b22e490576c488b3853c664dd.zip
frameworks_av-5d246efa220a7c7b22e490576c488b3853c664dd.tar.gz
frameworks_av-5d246efa220a7c7b22e490576c488b3853c664dd.tar.bz2
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 <arvindt@codeaurora.org>
Diffstat (limited to 'media/libmediaplayerservice/nuplayer')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp7
1 files changed, 5 insertions, 2 deletions
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<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;
}