Bug 1295296 - Assert that we don't see video tracks in ExternalAudioInputStream. r=jesup
authorAndreas Pehrson <pehrsons@gmail.com>
Wed, 17 Aug 2016 14:26:15 +0200
changeset 310062 ab241a57d6e83cf4c4a42a5891d6d5ecade93940
parent 310061 3fb31d11633e4f515117c421a4538bfb31edd497
child 310063 1a952d5e30464981a58a080a5066f60b6a376a7f
push id80771
push userkwierso@gmail.com
push dateThu, 18 Aug 2016 23:33:08 +0000
treeherdermozilla-inbound@cb1295738c37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1295296
milestone51.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 1295296 - Assert that we don't see video tracks in ExternalAudioInputStream. r=jesup MozReview-Commit-ID: Cw7KMFhY5Ai
dom/media/webaudio/AudioNodeExternalInputStream.cpp
--- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp
+++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp
@@ -147,23 +147,28 @@ AudioNodeExternalInputStream::ProcessInp
     return;
   }
 
   MOZ_ASSERT(mInputs.Length() == 1);
 
   MediaStream* source = mInputs[0]->GetSource();
   AutoTArray<AudioSegment,1> audioSegments;
   uint32_t inputChannels = 0;
-  for (StreamTracks::TrackIter tracks(source->mTracks, MediaSegment::AUDIO);
+  for (StreamTracks::TrackIter tracks(source->mTracks);
        !tracks.IsEnded(); tracks.Next()) {
     const StreamTracks::Track& inputTrack = *tracks;
     if (!mInputs[0]->PassTrackThrough(tracks->GetID())) {
       continue;
     }
 
+    if (inputTrack.GetSegment()->GetType() == MediaSegment::VIDEO) {
+      MOZ_ASSERT(false, "AudioNodeExternalInputStream shouldn't have video tracks");
+      continue;
+    }
+
     const AudioSegment& inputSegment =
         *static_cast<AudioSegment*>(inputTrack.GetSegment());
     if (inputSegment.IsNull()) {
       continue;
     }
 
     AudioSegment& segment = *audioSegments.AppendElement();
     GraphTime next;