Bug 1318965 - Changes the way the the 'DeinitializeDecoder' method in the ClearkeyCDM works r=cpearce

It is now more inline with the api spec in content_decryption_module

MozReview-Commit-ID: KmZzyfvHv5p

--HG--
extra : rebase_source : 783430c2d92018d686ddd8779bea1939936c618a
extra : histedit_source : 653ab1e717ce57c0f3eebfb3e6eddc6fa20d5884
This commit is contained in:
Jay Harris 2017-01-18 14:49:04 +13:00
Родитель edfd7cd803
Коммит 845adb059f
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -16,10 +16,6 @@ ClearKeyCDM::Initialize(bool aAllowDistinctiveIdentifier,
{
mSessionManager->Init(aAllowDistinctiveIdentifier,
aAllowPersistentState);
#ifdef ENABLE_WMF
mVideoDecoder = new VideoDecoder(mHost);
#endif
}
void
@ -121,6 +117,7 @@ ClearKeyCDM::InitializeVideoDecoder(
const VideoDecoderConfig& aVideoDecoderConfig)
{
#ifdef ENABLE_WMF
mVideoDecoder = new VideoDecoder(mHost);
return mVideoDecoder->InitDecode(aVideoDecoderConfig);
#else
return Status::kDecodeError;
@ -132,7 +129,8 @@ ClearKeyCDM::DeinitializeDecoder(StreamType aDecoderType)
{
#ifdef ENABLE_WMF
if (aDecoderType == StreamType::kStreamTypeVideo) {
mVideoDecoder->Reset();
mVideoDecoder->DecodingComplete();
mVideoDecoder = nullptr;
}
#endif
}
@ -190,6 +188,9 @@ ClearKeyCDM::Destroy()
{
mSessionManager->DecryptingComplete();
#ifdef ENABLE_WMF
mVideoDecoder->DecodingComplete();
// If we have called 'DeinitializeDecoder' mVideoDecoder will be null.
if (mVideoDecoder) {
mVideoDecoder->DecodingComplete();
}
#endif
}