diff options
author | Gu, Wangyi <wangyi.gu@intel.com> | 2013-02-05 14:10:14 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:03:40 -0700 |
commit | 274e417839e9335eccada4b08e082e238b0ed7dc (patch) | |
tree | cbd99130d5e6930061cda3001e5dc7e325c2daf9 /utils | |
parent | f94dc0afb6e4af367787f758a77e510c0bfe6b8a (diff) | |
download | wrs_omxil_core-274e417839e9335eccada4b08e082e238b0ed7dc.tar.gz |
[PORT FROM R4.1] Enhance the error handle mechanism in OMX Core to avoid video editor carsh
BZ: 75145
1. the dlerror will return the error caused by the main thread, this will lead the
ret equals -1, and this will make the loop not end in CModule destructor;
2. remove the redundant pthread_mutex_unlock;
3. add some error logs to expose some corner cases
Change-Id: Ifab1bb704ae1a65553be1326716558a4e013fada
Signed-off-by: Gu, Wangyi <wangyi.gu@intel.com>
Reviewed-on: http://android.intel.com:8080/90189
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Wang, Yi A <yi.a.wang@intel.com>
Reviewed-by: Shi, PingX <pingx.shi@intel.com>
Tested-by: Shi, PingX <pingx.shi@intel.com>
Reviewed-by: Gozalvez Herrero, Juan AntonioX <juan.antoniox.gozalvez.herrero@intel.com>
Tested-by: Gozalvez Herrero, Juan AntonioX <juan.antoniox.gozalvez.herrero@intel.com>
Diffstat (limited to 'utils')
-rw-r--r-- | utils/src/module.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/utils/src/module.c b/utils/src/module.c index 053e5e0..6adc5d4 100644 --- a/utils/src/module.c +++ b/utils/src/module.c @@ -131,7 +131,7 @@ struct module *module_open(const char *file, int flag) existing = module_find_with_name(g_module_head, file); if (existing) { - LOGE("found opened module %s\n", existing->name); + LOGE("found opened module %s with name\n", existing->name); existing->ref_count++; pthread_mutex_unlock(&g_lock); return existing; @@ -153,13 +153,12 @@ struct module *module_open(const char *file, int flag) LOGE("dlopen failed (%s)\n", file); dlerr = dlerror(); module_set_error(dlerr); - pthread_mutex_unlock(&g_lock); goto free_new; } existing = module_find_with_handle(g_module_head, new->handle); if (existing) { - LOGE("found opened module %s\n", existing->name); + LOGE("found opened module %s with handle\n", existing->name); existing->ref_count++; free(new); @@ -182,7 +181,6 @@ struct module *module_open(const char *file, int flag) if (init_ret) { LOGE("module %s init() failed (%d)\n", new->name, init_ret); - pthread_mutex_unlock(&g_lock); goto free_handle; } @@ -226,12 +224,8 @@ int module_close(struct module *module) if (module->exit) module->exit(module); - dlerror(); - dlclose(module->handle); - dlerr = dlerror(); - if (dlerr) { - module_set_error(dlerr); - ret = -1; + if (dlclose(module->handle)) { + LOGE("module %s dlclose failed",module->name); } g_module_head = module_del_list(g_module_head, module); |