Move AddOutputStream code below MediaDecoder::Load()

This commit is contained in:
trav90
2017-10-25 03:42:00 -05:00
committed by Roy Tam
parent d9c8eb26f8
commit eebc110658
2 changed files with 12 additions and 26 deletions
+6 -6
View File
@@ -2814,12 +2814,6 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
mDecoder->SetMinimizePrerollUntilPlaybackStarts();
}
for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
OutputMediaStream* ms = &mOutputStreams[i];
aDecoder->AddOutputStream(ms->mStream->GetStream()->AsProcessedStream(),
ms->mFinishWhenEnded);
}
// Update decoder principal before we start decoding, since it
// can affect how we feed data to MediaStreams
NotifyDecoderPrincipalChanged();
@@ -2831,6 +2825,12 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
return rv;
}
for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) {
OutputMediaStream* ms = &mOutputStreams[i];
aDecoder->AddOutputStream(ms->mStream->GetStream()->AsProcessedStream(),
ms->mFinishWhenEnded);
}
// Decoder successfully created, the decoder now owns the MediaResource
// which owns the channel.
mChannel = nullptr;