Commit b36d85f5 authored by John Rummell's avatar John Rummell Committed by Commit Bot

Don't report error when encryption pattern changes on desktop Chrome

Desktop Chrome specifies the DecryptConfig with each DecoderBuffer,
so having the pattern change is handled properly. Disabling the error
check as it is only needed for Android/Chromecast.

BUG=813845,877265
TEST=manual playback of faulty video

Change-Id: I8815906388003dec66ef113148b33801034bb02f
Reviewed-on: https://chromium-review.googlesource.com/1187713Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586808}
parent 310d28a8
...@@ -467,10 +467,11 @@ bool TrackRunIterator::Init(const MovieFragment& moof) { ...@@ -467,10 +467,11 @@ bool TrackRunIterator::Init(const MovieFragment& moof) {
// If we don't have a per-sample IV, get the constant IV. // If we don't have a per-sample IV, get the constant IV.
bool is_encrypted = index == 0 ? track_encryption->is_encrypted bool is_encrypted = index == 0 ? track_encryption->is_encrypted
: info_entry->is_encrypted; : info_entry->is_encrypted;
// We only support setting the pattern values in the 'tenc' box for #if defined(IS_CHROMECAST)
// the track (not varying on per sample group basis). // On Chromecast, we only support setting the pattern values in the
// Thus we need to verify that the settings in the sample group match // 'tenc' box for the track (not varying on per sample group basis).
// those in the 'tenc'. // Thus we need to verify that the settings in the sample group
// match those in the 'tenc'.
if (is_encrypted && index != 0) { if (is_encrypted && index != 0) {
RCHECK_MEDIA_LOGGED(info_entry->crypt_byte_block == RCHECK_MEDIA_LOGGED(info_entry->crypt_byte_block ==
track_encryption->default_crypt_byte_block, track_encryption->default_crypt_byte_block,
...@@ -485,6 +486,7 @@ bool TrackRunIterator::Init(const MovieFragment& moof) { ...@@ -485,6 +486,7 @@ bool TrackRunIterator::Init(const MovieFragment& moof) {
"sample group does not match that in the tenc " "sample group does not match that in the tenc "
"box . This is not currently supported."); "box . This is not currently supported.");
} }
#endif // defined(IS_CHROMECAST)
if (is_encrypted && !iv_size) { if (is_encrypted && !iv_size) {
const uint8_t constant_iv_size = const uint8_t constant_iv_size =
index == 0 ? track_encryption->default_constant_iv_size index == 0 ? track_encryption->default_constant_iv_size
...@@ -495,7 +497,7 @@ bool TrackRunIterator::Init(const MovieFragment& moof) { ...@@ -495,7 +497,7 @@ bool TrackRunIterator::Init(const MovieFragment& moof) {
: info_entry->constant_iv; : info_entry->constant_iv;
memcpy(entry.initialization_vector, constant_iv, constant_iv_size); memcpy(entry.initialization_vector, constant_iv, constant_iv_size);
} }
#endif #endif // BUILDFLAG(ENABLE_CBCS_ENCRYPTION_SCHEME)
} }
} }
runs_.push_back(tri); runs_.push_back(tri);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment