mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-30 14:17:36 -10:00
Bug 1300600 - Use TrackIter with for loop in AudioCaptureStream. r=padenot
Let's kill TrackIter with fire! MozReview-Commit-ID: KNDoEtX1iFk
This commit is contained in:
1 parent
0a80098e6a
commit
1382911fa5
1 file changed
+5
-5
@@ -102,12 +102,13 @@ AudioCaptureStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
|
||||
AudioSegment output;
|
||||
for (uint32_t i = 0; i < inputCount; i++) {
|
||||
MediaStream* s = mInputs[i]->GetSource();
|
||||
StreamTracks::TrackIter tracks(s->GetStreamTracks(), MediaSegment::AUDIO);
|
||||
while (!tracks.IsEnded()) {
|
||||
AudioSegment* inputSegment = tracks->Get<AudioSegment>();
|
||||
for (StreamTracks::TrackIter track(s->GetStreamTracks(),
|
||||
MediaSegment::AUDIO);
|
||||
!track.IsEnded(); track.Next()) {
|
||||
AudioSegment* inputSegment = track->Get<AudioSegment>();
|
||||
StreamTime inputStart = s->GraphTimeToStreamTimeWithBlocking(aFrom);
|
||||
StreamTime inputEnd = s->GraphTimeToStreamTimeWithBlocking(aTo);
|
||||
if (tracks->IsEnded() && inputSegment->GetDuration() <= inputEnd) {
|
||||
if (track->IsEnded() && inputSegment->GetDuration() <= inputEnd) {
|
||||
// If the input track has ended and we have consumed all its data it
|
||||
// can be ignored.
|
||||
continue;
|
||||
@@ -119,7 +120,6 @@ AudioCaptureStream::ProcessInput(GraphTime aFrom, GraphTime aTo,
|
||||
toMix.AppendNullData((aTo - aFrom) - (inputEnd - inputStart));
|
||||
}
|
||||
toMix.Mix(mMixer, MONO, Graph()->GraphRate());
|
||||
tracks.Next();
|
||||
}
|
||||
}
|
||||
// This calls MixerCallback below
|
||||
|
||||
Reference in new issue
Block a user