summaryrefslogtreecommitdiff
path: root/chromium/media
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-18 12:57:27 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-18 12:18:42 +0000
commit77c86be6077d3eee53d4b84ba5a2ff3b546e8324 (patch)
tree1a57e394567635c0a63fd25e8d39c5339ab5adc7 /chromium/media
parentbac1035f131c0b95b75fb39ffd1a39652843de9f (diff)
downloadqtwebengine-chromium-77c86be6077d3eee53d4b84ba5a2ff3b546e8324.tar.gz
BASELINE: Update Chromium to 77.0.3865.129
Change-Id: Ie569f0076f8854e83485a9beee9a3eb2f50d3362 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/media')
-rw-r--r--chromium/media/mojo/services/mojo_audio_decoder_service.cc7
-rw-r--r--chromium/media/mojo/services/mojo_renderer_service.cc7
-rw-r--r--chromium/media/mojo/services/mojo_video_decoder_service.cc7
3 files changed, 15 insertions, 6 deletions
diff --git a/chromium/media/mojo/services/mojo_audio_decoder_service.cc b/chromium/media/mojo/services/mojo_audio_decoder_service.cc
index d3d05728902..2434f712481 100644
--- a/chromium/media/mojo/services/mojo_audio_decoder_service.cc
+++ b/chromium/media/mojo/services/mojo_audio_decoder_service.cc
@@ -40,13 +40,16 @@ void MojoAudioDecoderService::Initialize(const AudioDecoderConfig& config,
// Get CdmContext from cdm_id if the stream is encrypted.
CdmContext* cdm_context = nullptr;
if (config.is_encrypted()) {
- cdm_context_ref_ = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
- if (!cdm_context_ref_) {
+ auto cdm_context_ref = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
+ if (!cdm_context_ref) {
DVLOG(1) << "CdmContextRef not found for CDM id: " << cdm_id;
std::move(callback).Run(false, false);
return;
}
+ // |cdm_context_ref_| must be kept as long as |cdm_context| is used by the
+ // |decoder_|.
+ cdm_context_ref_ = std::move(cdm_context_ref);
cdm_context = cdm_context_ref_->GetCdmContext();
DCHECK(cdm_context);
}
diff --git a/chromium/media/mojo/services/mojo_renderer_service.cc b/chromium/media/mojo/services/mojo_renderer_service.cc
index df09a776a54..00ca2bbc2e6 100644
--- a/chromium/media/mojo/services/mojo_renderer_service.cc
+++ b/chromium/media/mojo/services/mojo_renderer_service.cc
@@ -127,13 +127,16 @@ void MojoRendererService::SetCdm(int32_t cdm_id, SetCdmCallback callback) {
return;
}
- cdm_context_ref_ = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
- if (!cdm_context_ref_) {
+ auto cdm_context_ref = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
+ if (!cdm_context_ref) {
DVLOG(1) << "CdmContextRef not found for CDM ID: " << cdm_id;
std::move(callback).Run(false);
return;
}
+ // |cdm_context_ref_| must be kept as long as |cdm_context| is used by the
+ // |renderer_|.
+ cdm_context_ref_ = std::move(cdm_context_ref);
auto* cdm_context = cdm_context_ref_->GetCdmContext();
DCHECK(cdm_context);
diff --git a/chromium/media/mojo/services/mojo_video_decoder_service.cc b/chromium/media/mojo/services/mojo_video_decoder_service.cc
index 43b86504577..660250017b5 100644
--- a/chromium/media/mojo/services/mojo_video_decoder_service.cc
+++ b/chromium/media/mojo/services/mojo_video_decoder_service.cc
@@ -178,13 +178,16 @@ void MojoVideoDecoderService::Initialize(const VideoDecoderConfig& config,
// Get CdmContext from cdm_id if the stream is encrypted.
CdmContext* cdm_context = nullptr;
if (cdm_id != CdmContext::kInvalidCdmId) {
- cdm_context_ref_ = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
- if (!cdm_context_ref_) {
+ auto cdm_context_ref = mojo_cdm_service_context_->GetCdmContextRef(cdm_id);
+ if (!cdm_context_ref) {
DVLOG(1) << "CdmContextRef not found for CDM id: " << cdm_id;
OnDecoderInitialized(false);
return;
}
+ // |cdm_context_ref_| must be kept as long as |cdm_context| is used by the
+ // |decoder_|.
+ cdm_context_ref_ = std::move(cdm_context_ref);
cdm_context = cdm_context_ref_->GetCdmContext();
DCHECK(cdm_context);
}