Merge "Fix DASH movie playback decrypt error" into jb-mr2-dev
This commit is contained in:
@@ -96,6 +96,7 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
|
||||
// Iterate through subsamples, sending them to the CDM serially.
|
||||
size_t offset = 0;
|
||||
size_t encrypted_offset = 0;
|
||||
|
||||
for (size_t i = 0; i < numSubSamples; ++i) {
|
||||
const SubSample &subSample = subSamples[i];
|
||||
@@ -110,7 +111,7 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
CdmResponseType res = mCDM->Decrypt(mSessionId, false, keyId,
|
||||
source + offset,
|
||||
subSample.mNumBytesOfClearData,
|
||||
ivVector, offset % 16, dest + offset);
|
||||
ivVector, 0, dest + offset);
|
||||
|
||||
if (res != wvcdm::NO_ERROR) {
|
||||
ALOGE("Decrypt error result in session %s during unencrypted block: %d",
|
||||
@@ -127,7 +128,7 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
CdmResponseType res = mCDM->Decrypt(mSessionId, true, keyId,
|
||||
source + offset,
|
||||
subSample.mNumBytesOfEncryptedData,
|
||||
ivVector, offset % 16, dest + offset);
|
||||
ivVector, encrypted_offset % 16, dest + offset);
|
||||
|
||||
if (res != wvcdm::NO_ERROR) {
|
||||
ALOGE("Decrypt error result in session %s during encrypted block: %d",
|
||||
@@ -136,6 +137,7 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
}
|
||||
|
||||
offset += subSample.mNumBytesOfEncryptedData;
|
||||
encrypted_offset += subSample.mNumBytesOfEncryptedData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user