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

Unified Diff: media/base/android/media_codec_player.cc

Issue 1512173003: media: Refactor MediaCrypto creation and notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update TODO comments Created 5 years 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
Index: media/base/android/media_codec_player.cc
diff --git a/media/base/android/media_codec_player.cc b/media/base/android/media_codec_player.cc
index a58ac27b6e52bce5fbf0fc082b537d008a55bee2..1fb821d3b759d55609fd3ad3eb374ac6799d6a9a 100644
--- a/media/base/android/media_codec_player.cc
+++ b/media/base/android/media_codec_player.cc
@@ -937,7 +937,15 @@ void MediaCodecPlayer::OnMediaCryptoReady(
// and the surface requirement does not change until new SetCdm() is called.
DCHECK(media_crypto);
- DCHECK(!media_crypto->is_null());
+
+ if (media_crypto->is_null()) {
+ // TODO(timav): Fail playback nicely here if needed. Note that we could get
+ // here even though the stream to play is unencrypted and therefore
+ // MediaCrypto is not needed. In that case, we may ignore this error and
+ // continue playback, or fail the playback.
+ LOG(ERROR) << "MediaCrypto creation failed.";
+ return;
+ }
media_crypto_ = media_crypto.Pass();
« no previous file with comments | « media/base/android/java/src/org/chromium/media/MediaDrmBridge.java ('k') | media/base/android/media_decoder_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698