Fix incorrect error returns from DRM plugin
Includes Widevine library release 4.5.0.4946 Bug 5223230 Change-Id: Ie68d3a821c22b3b0b9b720560fee6768838f1a08
This commit is contained in:
@@ -854,10 +854,18 @@ status_t WVMDrmPlugin::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int
|
||||
|
||||
(*decBuffer)->length = encBuffer->length;
|
||||
|
||||
if (!mDrmPluginImpl->Operate(encBuffer->data, (*decBuffer)->data, encBuffer->length, iv)) {
|
||||
int status;
|
||||
status = mDrmPluginImpl->Operate(encBuffer->data, (*decBuffer)->data, encBuffer->length, iv);
|
||||
if (status != WVDRMPluginAPI::RIGHTS_VALID) {
|
||||
(*decBuffer)->length = 0;
|
||||
usleep(1000000); // prevent spinning
|
||||
return DRM_ERROR_LICENSE_EXPIRED;
|
||||
if (status == WVDRMPluginAPI::RIGHTS_NOT_ACQUIRED) {
|
||||
return DRM_ERROR_NO_LICENSE;
|
||||
} else if (status == WVDRMPluginAPI::RIGHTS_EXPIRED) {
|
||||
return DRM_ERROR_LICENSE_EXPIRED;
|
||||
} else if (status == WVDRMPluginAPI::RIGHTS_INVALID) {
|
||||
return DRM_ERROR_DECRYPT;
|
||||
}
|
||||
}
|
||||
|
||||
return DRM_NO_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user