Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: media/formats/mp2t/es_parser_h264.cc

Issue 2783703002: Declare intent to use sample-aes later in the stream. (Closed)
Patch Set: tweak needed for flush Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp2t/es_parser_adts.cc ('k') | media/formats/mp2t/mp2t_stream_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/es_parser_h264.cc
diff --git a/media/formats/mp2t/es_parser_h264.cc b/media/formats/mp2t/es_parser_h264.cc
index 340153de92990787c2a4682d138ad0eb7ba4e229..1e06d3f5b46d4ca83b307cf87eb54c296b86ca19 100644
--- a/media/formats/mp2t/es_parser_h264.cc
+++ b/media/formats/mp2t/es_parser_h264.cc
@@ -436,9 +436,15 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
CHECK_GE(es_size, access_unit_size);
#if BUILDFLAG(ENABLE_HLS_SAMPLE_AES)
+ const DecryptConfig* base_decrypt_config = nullptr;
+ if (use_hls_sample_aes_) {
+ DCHECK(!get_decrypt_config_cb_.is_null());
+ base_decrypt_config = get_decrypt_config_cb_.Run();
+ }
+
std::unique_ptr<uint8_t[]> adjusted_au;
std::vector<SubsampleEntry> subsamples;
- if (use_hls_sample_aes_) {
+ if (use_hls_sample_aes_ && base_decrypt_config) {
adjusted_au = AdjustAUForSampleAES(es, &access_unit_size, protected_blocks_,
&subsamples);
protected_blocks_.clear();
@@ -455,10 +461,7 @@ bool EsParserH264::EmitFrame(int64_t access_unit_pos,
stream_parser_buffer->SetDecodeTimestamp(current_timing_desc.dts);
stream_parser_buffer->set_timestamp(current_timing_desc.pts);
#if BUILDFLAG(ENABLE_HLS_SAMPLE_AES)
- if (use_hls_sample_aes_) {
- DCHECK(!get_decrypt_config_cb_.is_null());
- const DecryptConfig* base_decrypt_config = get_decrypt_config_cb_.Run();
- RCHECK(base_decrypt_config);
+ if (use_hls_sample_aes_ && base_decrypt_config) {
std::unique_ptr<DecryptConfig> decrypt_config(new DecryptConfig(
base_decrypt_config->key_id(), base_decrypt_config->iv(), subsamples));
stream_parser_buffer->set_decrypt_config(std::move(decrypt_config));
« no previous file with comments | « media/formats/mp2t/es_parser_adts.cc ('k') | media/formats/mp2t/mp2t_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698