am b4cd98c3: am 07478a67: Ensure terminate is called in all error cases

* commit 'b4cd98c39d9e726c18c77e96c2cd9774d0512f86':
  Ensure terminate is called in all error cases
This commit is contained in:
Jeff Tinker
2014-12-12 21:56:24 +00:00
committed by Android Git Automerger

View File

@@ -204,17 +204,17 @@ void WVMExtractorImpl::Initialize()
if (mSetupStatus != OK) {
setError(mSetupStatus);
#ifdef REQUIRE_SECURE_BUFFERS
if (mCryptoInitialized) {
OEMCrypto_Terminate();
}
#endif
}
WV_SetWarningToErrorMS(10000);
}
WVMExtractorImpl::~WVMExtractorImpl() {
#ifdef REQUIRE_SECURE_BUFFERS
if (mCryptoInitialized) {
OEMCrypto_Terminate();
}
#endif
}
// Release decrypt handle when media sources are destroyed
@@ -383,6 +383,9 @@ status_t WVMExtractorImpl::readMetaData()
mVideoSource = new WVMMediaSource(mSession, WV_EsSelector_Video, videoMetaData,
mIsLiveStream, cryptoPluginMode, mCryptoInitialized);
// responsibility for terminating has been delegated to WVMMediaSource
mCryptoInitialized = false;
// Since the WVExtractor goes away soon after this, we delegate ownership of some resources
// to the constructed media source
if (mFileSource.get()) {