diff options
author | Glenn Kasten <gkasten@google.com> | 2012-10-15 14:58:39 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-15 14:58:39 -0700 |
commit | abe703cc80610cc61279b36be8e50442b1f69f62 (patch) | |
tree | 71adb6447d64ecdd9a8f6714dfaafffe334460de | |
parent | 94e8d5e5e8bbf82035615cda85ef7cdb45fb2012 (diff) | |
parent | 2e5aa980c9eba995d99aa13e6b5fa2714dc9f61e (diff) | |
download | frameworks_av-abe703cc80610cc61279b36be8e50442b1f69f62.zip frameworks_av-abe703cc80610cc61279b36be8e50442b1f69f62.tar.gz frameworks_av-abe703cc80610cc61279b36be8e50442b1f69f62.tar.bz2 |
am 2e5aa980: Merge "Fix log spam: Failed to open libwvm.so" into jb-mr1-dev-plus-aosp
* commit '2e5aa980c9eba995d99aa13e6b5fa2714dc9f61e':
Fix log spam: Failed to open libwvm.so
-rw-r--r-- | media/libstagefright/WVMExtractor.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp index 31b2bcf..5ae80cc 100644 --- a/media/libstagefright/WVMExtractor.cpp +++ b/media/libstagefright/WVMExtractor.cpp @@ -72,15 +72,18 @@ WVMExtractor::WVMExtractor(const sp<DataSource> &source) } } -bool WVMExtractor::getVendorLibHandle() +static void init_routine() { - if (gVendorLibHandle == NULL) { - gVendorLibHandle = dlopen("libwvm.so", RTLD_NOW); - } - + gVendorLibHandle = dlopen("libwvm.so", RTLD_NOW); if (gVendorLibHandle == NULL) { ALOGE("Failed to open libwvm.so"); } +} + +bool WVMExtractor::getVendorLibHandle() +{ + static pthread_once_t sOnceControl = PTHREAD_ONCE_INIT; + pthread_once(&sOnceControl, init_routine); return gVendorLibHandle != NULL; } |