Bug 1183653: MediaFormatReader: returns error if no tracks are usable. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 15 Jul 2015 00:25:44 +1000
changeset 253138 47193134162b6c35527d3877c26765e330f7f725
parent 253137 798e3c758a62be0958dc5574617fd27b402720f7
child 253139 f81abae3fcea14413b559c2a99ec9b28ff672a12
push id29061
push userryanvm@gmail.com
push dateThu, 16 Jul 2015 18:53:45 +0000
treeherdermozilla-central@a0f4a688433d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1183653
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1183653: MediaFormatReader: returns error if no tracks are usable. r=cpearce
dom/media/MediaFormatReader.cpp
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -353,16 +353,21 @@ MediaFormatReader::OnDemuxerInitDone(nsr
   } else {
     mMainThreadDemuxer = mDemuxer->Clone();
   }
   if (!mMainThreadDemuxer) {
     mMetadataPromise.Reject(ReadMetadataFailureReason::METADATA_ERROR, __func__);
     NS_WARNING("Unable to clone current MediaDataDemuxer");
     return;
   }
+
+  if (!videoActive && !audioActive) {
+    mMetadataPromise.Reject(ReadMetadataFailureReason::METADATA_ERROR, __func__);
+    return;
+  }
   if (videoActive) {
     mVideoTrackDemuxer =
       mMainThreadDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0);
     MOZ_ASSERT(mVideoTrackDemuxer);
   }
   if (audioActive) {
     mAudioTrackDemuxer =
       mMainThreadDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0);