Fix for b/4132041 Widevine DRM plugin getConstraints not returning error
Change-Id: I07f02aabb4b68287eb7978abb5d106c86f2790b6
This commit is contained in:
Binary file not shown.
@@ -331,12 +331,16 @@ DrmConstraints* WVMDrmPlugin::onGetConstraints(int uniqueId, const String8* path
|
||||
bool denyHD;
|
||||
|
||||
std::string assetPath(path->string());
|
||||
if (!mDrmPluginImpl->GetConstraints(assetPath, &timeSincePlayback, &timeRemaining,
|
||||
bool isValid = mDrmPluginImpl->GetConstraints(assetPath, &timeSincePlayback, &timeRemaining,
|
||||
&licenseDuration, lastError, allowOffline,
|
||||
allowStreaming, denyHD))
|
||||
return NULL;
|
||||
allowStreaming, denyHD);
|
||||
|
||||
DrmConstraints* drmConstraints = new DrmConstraints();
|
||||
|
||||
String8 key = String8("WVLastErrorKey");
|
||||
drmConstraints->put(&key, lastError.c_str());
|
||||
|
||||
if (isValid) {
|
||||
char charValue[16]; // max uint32 = 0xffffffff + terminating char
|
||||
|
||||
memset(charValue, 0, 16);
|
||||
@@ -351,16 +355,15 @@ DrmConstraints* WVMDrmPlugin::onGetConstraints(int uniqueId, const String8* path
|
||||
sprintf(charValue, "%lu", (unsigned long)licenseDuration);
|
||||
drmConstraints->put(&(DrmConstraints::LICENSE_AVAILABLE_TIME), charValue);
|
||||
|
||||
String8 key = String8("WVLicenseTypeKey");
|
||||
key = String8("WVLicenseTypeKey");
|
||||
sprintf(charValue, "%u", (allowStreaming ? 1 : 0) | (allowOffline ? 2 : 0));
|
||||
drmConstraints->put(&key, charValue);
|
||||
|
||||
key = String8("WVLicensedResolutionKey");
|
||||
sprintf(charValue, "%u", (denyHD ? 1 : 2));
|
||||
drmConstraints->put(&key, charValue);
|
||||
}
|
||||
|
||||
key = String8("WVLastErrorKey");
|
||||
drmConstraints->put(&key, lastError.c_str());
|
||||
return drmConstraints;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user