am 40abceaa: Merge "Fix DASH movie playback decrypt error" into jb-mr2-dev

* commit '40abceaaed7a1fb4543482db918d5616f244833c':
  Fix DASH movie playback decrypt error
This commit is contained in:
Jeff Tinker
2013-04-14 17:02:55 -07:00
committed by Android Git Automerger

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