Move OEMCrypto_Initialize earlier

Some OEMCrypto calls are happening before OEMCrypto_Initialize.
This change moves initialization earlier so it occurs before
any other calls to OEMCrypto.

bug: 10582250
Change-Id: Ic8992e8f0738dbfeb10074a4e1543bb9931a49d5
This commit is contained in:
Jeff Tinker
2013-10-28 15:19:15 -07:00
parent 6fc2ee33c3
commit acb47e0f9a
4 changed files with 16 additions and 16 deletions

View File

@@ -28,14 +28,14 @@ int64_t WVMMediaSource::sLastSeekTimeUs = -1;
WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector,
const sp<MetaData> &metaData, bool isLive,
bool cryptoPluginMode)
bool cryptoPluginMode, bool cryptoInitialized)
: mSession(session),
mESSelector(esSelector),
mTrackMetaData(metaData),
mStarted(false),
mIsLiveStream(isLive),
mNewSegment(false),
mCryptoInitialized(false),
mCryptoInitialized(cryptoInitialized),
mStripADTS(false),
mCryptoPluginMode(cryptoPluginMode),
mGroup(NULL),
@@ -45,16 +45,6 @@ WVMMediaSource::WVMMediaSource(WVSession *session, WVEsSelector esSelector,
{
_ah010(_cb);
#ifdef REQUIRE_SECURE_BUFFERS
if (esSelector == WV_EsSelector_Video) {
if (!cryptoPluginMode) {
OEMCryptoResult result = OEMCrypto_Initialize();
if (result == OEMCrypto_SUCCESS) {
mCryptoInitialized = true;
} else {
ALOGE("Crypto initialize failed (%d)", result);
}
}
}
mStripADTS = true;
#else
if (cryptoPluginMode) {