Bug 1333979 - Adds a check in the WidevineVideoDecoder before shutting down r=cpearce

DeinitializeDecoder will now only be called if InitializeDecoder has been called first

MozReview-Commit-ID: 93WexomWp92

--HG--
extra : rebase_source : 96dfa5666041340d56fbfce7a46fb7f8f67181dc
This commit is contained in:
Jay Harris 2017-01-27 10:54:04 +13:00
Родитель ff0d7b7db5
Коммит 7c7fa081d8
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -383,10 +383,18 @@ void
WidevineVideoDecoder::DecodingComplete()
{
Log("WidevineVideoDecoder::DecodingComplete()");
if (mCDMWrapper) {
CDM()->DeinitializeDecoder(kStreamTypeVideo);
// mCallback will be null if the decoder has not been fully initialized.
if (mCallback) {
CDM()->DeinitializeDecoder(kStreamTypeVideo);
} else {
Log("WideVineDecoder::DecodingComplete() Decoder was not fully initialized!");
}
mCDMWrapper = nullptr;
}
// Release that corresponds to AddRef() in constructor.
Release();
}

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

@ -59,7 +59,7 @@ private:
RefPtr<CDMWrapper> mCDMWrapper;
RefPtr<MediaByteBuffer> mExtraData;
RefPtr<MediaByteBuffer> mAnnexB;
GMPVideoDecoderCallback* mCallback;
GMPVideoDecoderCallback* mCallback = nullptr;
std::map<uint64_t, uint64_t> mFrameDurations;
bool mSentInput;
GMPVideoCodecType mCodecType;