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

Commit 5d246efa authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Iliyan Malchev
Browse files

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: default avatarArvind Thatikonda <arvindt@codeaurora.org>
parent 45dfb6ae
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -258,7 +258,9 @@ void NuPlayer::onMessageReceived(const sp<AMessage> &msg) {
            ALOGV("scanning sources haveAudio=%d, haveVideo=%d",
                 mAudioDecoder != NULL, mVideoDecoder != NULL);

            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;
            }