mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1054824 - Detect GMP death in EMEDecryptors. r=edwin
This commit is contained in:
parent
04e09eae6c
commit
d4561a8eff
@ -311,6 +311,14 @@ void
|
||||
CDMProxy::gmp_Shutdown()
|
||||
{
|
||||
MOZ_ASSERT(IsOnGMPThread());
|
||||
|
||||
// Abort any pending decrypt jobs, to awaken any clients waiting on a job.
|
||||
for (size_t i = 0; i < mDecryptionJobs.Length(); i++) {
|
||||
DecryptJob* job = mDecryptionJobs[i];
|
||||
job->mClient->Decrypted(NS_ERROR_ABORT, nullptr);
|
||||
}
|
||||
mDecryptionJobs.Clear();
|
||||
|
||||
if (mCDM) {
|
||||
mCDM->Close();
|
||||
mCDM = nullptr;
|
||||
@ -487,11 +495,14 @@ CDMProxy::gmp_Decrypted(uint32_t aId,
|
||||
if (aDecryptedData.Length() != job->mSample->size) {
|
||||
NS_WARNING("CDM returned incorrect number of decrypted bytes");
|
||||
}
|
||||
PodCopy(job->mSample->data,
|
||||
aDecryptedData.Elements(),
|
||||
std::min<size_t>(aDecryptedData.Length(), job->mSample->size));
|
||||
nsresult rv = GMP_SUCCEEDED(aResult) ? NS_OK : NS_ERROR_FAILURE;
|
||||
job->mClient->Decrypted(rv, job->mSample.forget());
|
||||
if (GMP_SUCCEEDED(aResult)) {
|
||||
PodCopy(job->mSample->data,
|
||||
aDecryptedData.Elements(),
|
||||
std::min<size_t>(aDecryptedData.Length(), job->mSample->size));
|
||||
job->mClient->Decrypted(NS_OK, job->mSample.forget());
|
||||
} else {
|
||||
job->mClient->Decrypted(NS_ERROR_FAILURE, nullptr);
|
||||
}
|
||||
mDecryptionJobs.RemoveElementAt(i);
|
||||
return;
|
||||
} else {
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE {
|
||||
if (NS_FAILED(aResult)) {
|
||||
mDecryptor->mCallback->Error();
|
||||
delete aSample;
|
||||
MOZ_ASSERT(!aSample);
|
||||
} else {
|
||||
RefPtr<nsIRunnable> task;
|
||||
task = NS_NewRunnableMethodWithArg<MP4Sample*>(mDecryptor,
|
||||
|
Loading…
Reference in New Issue
Block a user