From 4cf1bdef135d6ebf6ccd404aacc8917f9887a07a Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Fri, 16 Nov 2012 11:15:44 -0800 Subject: Only pass the surface to the video decoder. Change-Id: Ice0cfc0021fdd9fe053be6ee324cbc64226ed122 --- cmds/stagefright/SimplePlayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cmds/stagefright') diff --git a/cmds/stagefright/SimplePlayer.cpp b/cmds/stagefright/SimplePlayer.cpp index 7636906..eb3296e 100644 --- a/cmds/stagefright/SimplePlayer.cpp +++ b/cmds/stagefright/SimplePlayer.cpp @@ -297,9 +297,11 @@ status_t SimplePlayer::onPrepare() { AString mime; CHECK(format->findString("mime", &mime)); + bool isVideo = !strncasecmp(mime.c_str(), "video/", 6); + if (!haveAudio && !strncasecmp(mime.c_str(), "audio/", 6)) { haveAudio = true; - } else if (!haveVideo && !strncasecmp(mime.c_str(), "video/", 6)) { + } else if (!haveVideo && isVideo) { haveVideo = true; } else { continue; @@ -320,7 +322,7 @@ status_t SimplePlayer::onPrepare() { err = state->mCodec->configure( format, - mNativeWindow->getSurfaceTextureClient(), + isVideo ? mNativeWindow->getSurfaceTextureClient() : NULL, NULL /* crypto */, 0 /* flags */); -- cgit v1.1