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

Unified Diff: webrtc/video/video_decoder.cc

Issue 2091923002: Create a null decoder for h264 when not supported, instead of crashing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed DCHECK and cleared up comment. Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_decoder.cc
diff --git a/webrtc/video/video_decoder.cc b/webrtc/video/video_decoder.cc
index 5bf503cd80242632bc57414e412ac62fc653579e..b15a83f7b3f3038923985c6b1a281278172ed4db 100644
--- a/webrtc/video/video_decoder.cc
+++ b/webrtc/video/video_decoder.cc
@@ -20,7 +20,15 @@ namespace webrtc {
VideoDecoder* VideoDecoder::Create(VideoDecoder::DecoderType codec_type) {
switch (codec_type) {
case kH264:
- RTC_DCHECK(H264Decoder::IsSupported());
+ if (!H264Decoder::IsSupported()) {
+ // This could happen in a software-fallback for a codec type only
+ // supported externally (e.g. H.264 on iOS or Android) or in current
+ // usage in WebRtcVideoEngine2 if the external decoder fails to be
+ // created.
+ LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. "
+ << "Decoding of this stream will be broken.";
+ return new NullVideoDecoder();
+ }
return H264Decoder::Create();
case kVp8:
return VP8Decoder::Create();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698