diff options
author | Ronghua Wu <ronghuawu@google.com> | 2015-04-08 17:50:14 -0700 |
---|---|---|
committer | Ronghua Wu <ronghuawu@google.com> | 2015-04-10 13:23:17 -0700 |
commit | 9f41ee5a4dd73093d107bc80df5cebb9a273cc72 (patch) | |
tree | 9f7f2be412cbaf38d0a62e423c4a46b533155a02 /media | |
parent | 303db9de6506db0c2b300863c39ece81721dd4e9 (diff) | |
download | frameworks_av-9f41ee5a4dd73093d107bc80df5cebb9a273cc72.zip frameworks_av-9f41ee5a4dd73093d107bc80df5cebb9a273cc72.tar.gz frameworks_av-9f41ee5a4dd73093d107bc80df5cebb9a273cc72.tar.bz2 |
libstagefright: propagate error from allocateNode.
Bug: 19620911
Change-Id: Iee288343d7d851a395052e1b3354eb98b026e4fb
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/ACodec.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 97f3e20..d682cc6 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -4902,6 +4902,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { sp<CodecObserver> observer = new CodecObserver; IOMX::node_id node = NULL; + status_t err = OMX_ErrorComponentNotFound; for (size_t matchIndex = 0; matchIndex < matchingCodecs.size(); ++matchIndex) { componentName = matchingCodecs.itemAt(matchIndex).mName.string(); @@ -4910,7 +4911,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { pid_t tid = gettid(); int prevPriority = androidGetThreadPriority(tid); androidSetThreadPriority(tid, ANDROID_PRIORITY_FOREGROUND); - status_t err = omx->allocateNode(componentName.c_str(), observer, &node); + err = omx->allocateNode(componentName.c_str(), observer, &node); androidSetThreadPriority(tid, prevPriority); if (err == OK) { @@ -4924,13 +4925,13 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { if (node == NULL) { if (!mime.empty()) { - ALOGE("Unable to instantiate a %scoder for type '%s'.", - encoder ? "en" : "de", mime.c_str()); + ALOGE("Unable to instantiate a %scoder for type '%s' with err %#x.", + encoder ? "en" : "de", mime.c_str(), err); } else { - ALOGE("Unable to instantiate codec '%s'.", componentName.c_str()); + ALOGE("Unable to instantiate codec '%s' with err %#x.", componentName.c_str(), err); } - mCodec->signalError(OMX_ErrorComponentNotFound); + mCodec->signalError(err, makeNoSideEffectStatus(err)); return false; } |