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:
@@ -63,7 +63,7 @@ class WVDRMPluginAPI {
|
|||||||
virtual bool RemoveRights(std::string &path) = 0;
|
virtual bool RemoveRights(std::string &path) = 0;
|
||||||
virtual bool RemoveAllRights() = 0;
|
virtual bool RemoveAllRights() = 0;
|
||||||
virtual bool Prepare(char *data, int len) = 0;
|
virtual bool Prepare(char *data, int len) = 0;
|
||||||
virtual bool Operate(char *in, char *out, int len, char *iv) = 0;
|
virtual int Operate(char *in, char *out, int len, char *iv) = 0;
|
||||||
|
|
||||||
enum EventType {
|
enum EventType {
|
||||||
EventType_AcquireDrmInfoFailed,
|
EventType_AcquireDrmInfoFailed,
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -854,10 +854,18 @@ status_t WVMDrmPlugin::onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int
|
|||||||
|
|
||||||
(*decBuffer)->length = encBuffer->length;
|
(*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;
|
(*decBuffer)->length = 0;
|
||||||
usleep(1000000); // prevent spinning
|
usleep(1000000); // prevent spinning
|
||||||
|
if (status == WVDRMPluginAPI::RIGHTS_NOT_ACQUIRED) {
|
||||||
|
return DRM_ERROR_NO_LICENSE;
|
||||||
|
} else if (status == WVDRMPluginAPI::RIGHTS_EXPIRED) {
|
||||||
return DRM_ERROR_LICENSE_EXPIRED;
|
return DRM_ERROR_LICENSE_EXPIRED;
|
||||||
|
} else if (status == WVDRMPluginAPI::RIGHTS_INVALID) {
|
||||||
|
return DRM_ERROR_DECRYPT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return DRM_NO_ERROR;
|
return DRM_NO_ERROR;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user