summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/WVMExtractor.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-10-12 15:59:28 -0700
committerGlenn Kasten <gkasten@google.com>2012-10-12 16:00:50 -0700
commit75e351348e11f75b3db6b6ab388cc31d5702ea2e (patch)
tree86b7d3bbd5d39859b0322caf5237218a985f656c /media/libstagefright/WVMExtractor.cpp
parent0342e9a31648dca41cff257e4c2016062ea27596 (diff)
downloadframeworks_av-75e351348e11f75b3db6b6ab388cc31d5702ea2e.zip
frameworks_av-75e351348e11f75b3db6b6ab388cc31d5702ea2e.tar.gz
frameworks_av-75e351348e11f75b3db6b6ab388cc31d5702ea2e.tar.bz2
Fix log spam: Failed to open libwvm.so
Bug: 7342813 Change-Id: I98852f036e4679a653723fc2bf1435d6e9d7d34c
Diffstat (limited to 'media/libstagefright/WVMExtractor.cpp')
-rw-r--r--media/libstagefright/WVMExtractor.cpp13
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;
}