Bug 1383628. P2 - move the call to Load() into Clone(). r=gerald

MozReview-Commit-ID: 9k8BXLwAepI
This commit is contained in:
JW Wang
2017-08-03 17:47:23 +08:00
parent 08b63f56e6
commit 16a9ff0929
3 changed files with 12 additions and 13 deletions

View File

@@ -4721,10 +4721,6 @@ HTMLMediaElement::InitializeDecoderAsClone(ChannelMediaDecoder* aOriginal)
NS_ASSERTION(mLoadingSrc, "mLoadingSrc must already be set");
NS_ASSERTION(mDecoder == nullptr, "Shouldn't have a decoder");
MediaResource* originalResource = aOriginal->GetResource();
if (!originalResource)
return NS_ERROR_FAILURE;
MediaDecoderInit decoderInit(this,
mAudioChannel,
mMuted ? 0.0 : mVolume,
@@ -4742,14 +4738,6 @@ HTMLMediaElement::InitializeDecoderAsClone(ChannelMediaDecoder* aOriginal)
LOG(LogLevel::Debug, ("%p Cloned decoder %p from %p", this, decoder.get(), aOriginal));
nsresult rv = decoder->Load(originalResource);
if (NS_FAILED(rv)) {
decoder->Shutdown();
LOG(LogLevel::Debug,
("%p Failed to load for decoder %p", this, decoder.get()));
return rv;
}
return FinishDecoderSetup(decoder);
}