diff options
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp | 7 | ||||
-rw-r--r-- | media/libstagefright/ACodec.cpp | 12 |
2 files changed, 13 insertions, 6 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp index 8fce2f4..37ecbf1 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp @@ -478,10 +478,13 @@ void NuPlayer::Decoder::onShutdown() { if (mNativeWindow != NULL) { // reconnect to surface as MediaCodec disconnected from it - CHECK_EQ((int)NO_ERROR, + status_t error = native_window_api_connect( mNativeWindow->getNativeWindow().get(), - NATIVE_WINDOW_API_MEDIA)); + NATIVE_WINDOW_API_MEDIA); + ALOGW_IF(error != NO_ERROR, + "[%s] failed to connect to native window, error=%d", + mComponentName.c_str(), error); } mComponentName = "decoder"; } diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index b44d5cc..e4e463a 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -813,7 +813,10 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() { for (OMX_U32 i = cancelStart; i < cancelEnd; i++) { BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i); - cancelBufferToNativeWindow(info); + status_t error = cancelBufferToNativeWindow(info); + if (err == 0) { + err = error; + } } return err; @@ -888,11 +891,12 @@ status_t ACodec::cancelBufferToNativeWindow(BufferInfo *info) { int err = mNativeWindow->cancelBuffer( mNativeWindow.get(), info->mGraphicBuffer.get(), -1); - CHECK_EQ(err, 0); + ALOGW_IF(err != 0, "[%s] can not return buffer %u to native window", + mComponentName.c_str(), info->mBufferID); info->mStatus = BufferInfo::OWNED_BY_NATIVE_WINDOW; - return OK; + return err; } ACodec::BufferInfo *ACodec::dequeueBufferFromNativeWindow() { @@ -992,7 +996,7 @@ status_t ACodec::freeBuffer(OMX_U32 portIndex, size_t i) { if (portIndex == kPortIndexOutput && mNativeWindow != NULL && info->mStatus == BufferInfo::OWNED_BY_US) { - CHECK_EQ((status_t)OK, cancelBufferToNativeWindow(info)); + cancelBufferToNativeWindow(info); } CHECK_EQ(mOMX->freeBuffer( |