Fix DASH movie playback decrypt error

Decryption works now with Exoplayer

bug:8604068
Change-Id: Ib24fcd4bb1fce54db9111f3c51e6ab1ff6f475a3
This commit is contained in:
Jeff Tinker
2013-04-13 11:30:17 -07:00
parent e6b1fedc4c
commit 4f47afda9f

View File

@@ -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;
}
}