From d323d4f091c09cb4eb75a5481bbf2e6838394350 Mon Sep 17 00:00:00 2001 From: Kongqun Yang Date: Wed, 22 Mar 2017 09:57:18 -0700 Subject: [PATCH] Fix break in Windows (#213) --- packager/media/crypto/encryption_handler.cc | 2 +- .../media/crypto/encryption_handler_unittest.cc | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packager/media/crypto/encryption_handler.cc b/packager/media/crypto/encryption_handler.cc index a7471d0fef..4ae87aa79c 100644 --- a/packager/media/crypto/encryption_handler.cc +++ b/packager/media/crypto/encryption_handler.cc @@ -383,7 +383,7 @@ bool EncryptionHandler::CreateEncryptor(const EncryptionKey& encryption_key) { encryption_config_->per_sample_iv_size = 0; encryption_config_->constant_iv = iv; } else { - encryption_config_->per_sample_iv_size = iv.size(); + encryption_config_->per_sample_iv_size = static_cast(iv.size()); } encryption_config_->key_id = encryption_key.key_id; encryption_config_->key_system_info = encryption_key.key_system_info; diff --git a/packager/media/crypto/encryption_handler_unittest.cc b/packager/media/crypto/encryption_handler_unittest.cc index 7cc38317a3..1c6d5e4de0 100644 --- a/packager/media/crypto/encryption_handler_unittest.cc +++ b/packager/media/crypto/encryption_handler_unittest.cc @@ -228,19 +228,23 @@ class EncryptionHandlerEncryptionTest if (codec_ == kCodecAAC) return subsamples; if (protection_scheme_ == kAppleSampleAesProtectionScheme) { - subsamples.emplace_back(kSampleAesClearSize1, kSampleAesCipherSize1); - subsamples.emplace_back(kSubsampleSize3, 0u); + subsamples.emplace_back(static_cast(kSampleAesClearSize1), + static_cast(kSampleAesCipherSize1)); + subsamples.emplace_back(static_cast(kSubsampleSize3), 0u); } else { if (codec_ == kCodecVP9 || protection_scheme_ == FOURCC_cbc1 || protection_scheme_ == FOURCC_cens) { // Align the encrypted bytes to multiple of 16 bytes. - subsamples.emplace_back(kAlignedClearSize1, kAlignedCipherSize1); + subsamples.emplace_back(static_cast(kAlignedClearSize1), + static_cast(kAlignedCipherSize1)); // Subsample 2 is already aligned. } else { - subsamples.emplace_back(kClearSize1, kCipherSize1); + subsamples.emplace_back(static_cast(kClearSize1), + static_cast(kCipherSize1)); } - subsamples.emplace_back(kClearSize2, kCipherSize2); - subsamples.emplace_back(kSubsampleSize3, 0u); + subsamples.emplace_back(static_cast(kClearSize2), + static_cast(kCipherSize2)); + subsamples.emplace_back(static_cast(kSubsampleSize3), 0u); } return subsamples; }