aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2009-12-16 10:23:55 -0800
committerJames Dong <jdong@google.com>2009-12-16 10:23:55 -0800
commitfd114eeae00047ce9d965af7708ae2774926705b (patch)
treeb1fe636ba048398156555a1189b22bfb17b66c58
parentf79964007dc0092755216ee94bbdc699537e2a74 (diff)
downloadopencore-fd114eeae00047ce9d965af7708ae2774926705b.tar.gz
Fix a bug in finding a sw-based codec where a hw-based codec may be used although a sw-based codec was found
-rw-r--r--codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp b/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
index 20662ed8c..2a9ccb1ff 100644
--- a/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
+++ b/codecs_v2/omx/omx_mastercore/src/pv_omxmastercore.cpp
@@ -588,21 +588,26 @@ OSCL_EXPORT_REF OMX_ERRORTYPE OMX_APIENTRY OMX_MasterGetHandle(
}
}
}
- if (ii == (data->iTotalNumOMXComponents) && hwCodecFoundWhenSoftwareCodecIsRequested == -1)
+ if (ii == (data->iTotalNumOMXComponents))
{
- // could not find a component with the given name
- OsclSingletonRegistry::registerInstanceAndUnlock(data, OSCL_SINGLETON_ID_OMXMASTERCORE, error);
- if (error)
+ if (hwCodecFoundWhenSoftwareCodecIsRequested == -1)
{
- //registry error
- Status = OMX_ErrorUndefined;
- return Status;
+ // could not find ANY component with the given name
+ OsclSingletonRegistry::registerInstanceAndUnlock(data, OSCL_SINGLETON_ID_OMXMASTERCORE, error);
+ if (error)
+ {
+ //registry error
+ Status = OMX_ErrorUndefined;
+ return Status;
+ }
+ return OMX_ErrorComponentNotFound;
+ }
+ else
+ {
+ // we have not found a sw-based codec while requesting sw-based codecs.
+ // but we found a hw-based codec, and as a last resort, use it anyway.
+ ii = hwCodecFoundWhenSoftwareCodecIsRequested;
}
- return OMX_ErrorComponentNotFound;
- }
- else if (hwCodecFoundWhenSoftwareCodecIsRequested != -1)
- {
- ii = hwCodecFoundWhenSoftwareCodecIsRequested;
}
// call the appropriate GetHandle for the component