Bug 1060896 - Don't decode video without an ImageContainer. r=cpearce
authorBen Craddock <bcc@uga.edu>
Thu, 09 Oct 2014 07:42:12 +1300
changeset 209383 02b1fce67dad201b5f3b7fb52e21f80fb708c9e8
parent 209382 c6bd8c963e9454d1bf8981fb0c54bd7033cdc93d
child 209384 2c12f4eb260763dde41867ad0255ff5fff72f7e5
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerscpearce
bugs1060896
milestone35.0a1
Bug 1060896 - Don't decode video without an ImageContainer. r=cpearce
content/media/fmp4/MP4Reader.cpp
--- a/content/media/fmp4/MP4Reader.cpp
+++ b/content/media/fmp4/MP4Reader.cpp
@@ -305,17 +305,19 @@ MP4Reader::ReadMetadata(MediaInfo* aInfo
     bool ok = mDemuxer->Init();
     NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
 
     {
       MonitorAutoLock mon(mIndexMonitor);
       mIndexReady = true;
     }
 
-    mInfo.mVideo.mHasVideo = mVideo.mActive = mDemuxer->HasValidVideo();
+    // To decode, we need valid video and a place to put it.
+    mInfo.mVideo.mHasVideo = mVideo.mActive = mDemuxer->HasValidVideo() &&
+                                              mDecoder->GetImageContainer();
     const VideoDecoderConfig& video = mDemuxer->VideoConfig();
     // If we have video, we *only* allow H.264 to be decoded.
     if (mInfo.mVideo.mHasVideo && strcmp(video.mime_type, "video/avc")) {
       return NS_ERROR_FAILURE;
     }
 
     mInfo.mAudio.mHasAudio = mAudio.mActive = mDemuxer->HasValidAudio();