From bf2ba2a97927c24d14c0e71158abe7b49c557c68 Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 20 Oct 2010 15:53:59 -0700 Subject: Fix the non-ANW video decode path. The BufferInfo::mOwnedByNativeWindow field was not being initialized in the non-ANativeWindow video decode path. Change-Id: If2f6249902a08690f6c62ef30791b9979050c0e5 --- media/libstagefright/OMXCodec.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 560d0f1..2e368b6 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -744,7 +744,8 @@ status_t OMXCodec::configureCodec(const sp &meta, uint32_t flags) { mQuirks &= ~kOutputBuffersAreUnreadable; } - if (!mIsEncoder + if (mNativeWindow != NULL + && !mIsEncoder && !strncasecmp(mMIME, "video/", 6) && !strncmp(mComponentName, "OMX.", 4)) { status_t err = initNativeWindow(); @@ -1606,7 +1607,7 @@ status_t OMXCodec::allocateBuffers() { } status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { - if (mNativeWindow != 0 && portIndex == kPortIndexOutput) { + if (mNativeWindow != NULL && portIndex == kPortIndexOutput) { return allocateOutputBuffersFromNativeWindow(); } @@ -1676,6 +1677,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { info.mBuffer = buffer; info.mOwnedByComponent = false; + info.mOwnedByNativeWindow = false; info.mMem = mem; info.mMediaBuffer = NULL; -- cgit v1.1