mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 05:45:33 +00:00
Bug 926665 - Clear mMediaSource when Attach fails. r=doublec.
This commit is contained in:
parent
047acd439f
commit
8465bcf506
@ -1137,14 +1137,14 @@ nsresult HTMLMediaElement::LoadResource()
|
||||
ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
|
||||
return rv;
|
||||
}
|
||||
mMediaSource = source.forget();
|
||||
nsRefPtr<MediaSourceDecoder> decoder = new MediaSourceDecoder(this);
|
||||
if (!mMediaSource->Attach(decoder)) {
|
||||
if (!source->Attach(decoder)) {
|
||||
// TODO: Handle failure: run "If the media data cannot be fetched at
|
||||
// all, due to network errors, causing the user agent to give up
|
||||
// trying to fetch the resource" section of resource fetch algorithm.
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
mMediaSource = source.forget();
|
||||
nsRefPtr<MediaResource> resource = new MediaSourceResource();
|
||||
return FinishDecoderSetup(decoder, resource, nullptr, nullptr);
|
||||
}
|
||||
|
26
content/media/test/crashtests/926665.html
Normal file
26
content/media/test/crashtests/926665.html
Normal file
@ -0,0 +1,26 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<script style="display: none;" id="fuzz1" type="text/javascript;version=1.7">
|
||||
|
||||
function boom()
|
||||
{
|
||||
var mediaSource = new window.MediaSource();
|
||||
var mediaSourceURL = URL.createObjectURL(mediaSource);
|
||||
var v1 = document.createElement('video');
|
||||
v1.src = mediaSourceURL;
|
||||
mediaSource.addEventListener("sourceopen", function (e) {
|
||||
var v2 = document.createElement('video');
|
||||
v2.src = mediaSourceURL;
|
||||
setTimeout(function () {
|
||||
v2.src = "data:text/plain,1";
|
||||
v1.src = "data:text/plain,2";
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="boom();"></body>
|
||||
</html>
|
@ -59,3 +59,4 @@ load 910171-1.html
|
||||
load 920987.html
|
||||
skip-if(B2G) load oscillator-ended-1.html # intermittent B2G timeouts, bug 920338
|
||||
skip-if(B2G) load oscillator-ended-2.html # intermittent B2G timeouts, bug 920338
|
||||
test-pref(media.mediasource.enabled,true) load 926665.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user