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

Unified Diff: media/filters/decoder_stream.cc

Issue 2701203003: media: Prefer decrypting pipeline when CDM is attached (Closed)
Patch Set: comments addressed Created 3 years, 10 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/filters/decoder_selector.cc ('k') | media/filters/decrypting_audio_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decoder_stream.cc
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc
index 623d266449ca1adf335c529cf7a7ef593a6bffb2..7320b26423c3add4c08b309d741c4ee428a33eeb 100644
--- a/media/filters/decoder_stream.cc
+++ b/media/filters/decoder_stream.cc
@@ -251,8 +251,14 @@ base::TimeDelta DecoderStream<StreamType>::AverageDuration() const {
template <DemuxerStream::Type StreamType>
void DecoderStream<StreamType>::SelectDecoder() {
+ // If we are already using DecryptingDemuxerStream (DDS), e.g. during
+ // fallback, the |stream_| will always be clear. In this case, no need pass in
+ // the |cdm_context_|. This will also help prevent creating a new DDS on top
+ // of the current DDS.
+ CdmContext* cdm_context = decrypting_demuxer_stream_ ? nullptr : cdm_context_;
+
decoder_selector_->SelectDecoder(
- &traits_, stream_, cdm_context_,
+ &traits_, stream_, cdm_context,
base::Bind(&DecoderStream<StreamType>::OnDecoderSelected,
weak_factory_.GetWeakPtr()),
base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady,
« no previous file with comments | « media/filters/decoder_selector.cc ('k') | media/filters/decrypting_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698