Bug 980622 - Free media element node to release decoder. r=cajbir

This commit is contained in:
Alfredo Yang 2015-01-27 02:27:00 -05:00
parent 8f717b3299
commit 9584dfbd73

View File

@ -28,7 +28,14 @@ function mediaEnded(event) {
ok(Math.abs(event.target.currentTime - event.target._expectedDuration) < 0.1,
"currentTime equals duration: " + filename(event.target.currentSrc));
event.target.removeEventListener("ended", mediaEnded, false);
manager.finished(event.target.token);
removeNodeAndSource(event.target);
}
function mediaLoadedmetadata(event) {
event.target.currentTime = event.target.duration;
event.target.removeEventListener("loadedmetadata", mediaLoadedmetadata, false);
}
function startTest(test, token) {
@ -40,9 +47,7 @@ function startTest(test, token) {
if (test.duration) {
v1._expectedDuration = test.duration;
}
v1.addEventListener("loadedmetadata", function (event) {
event.target.currentTime = event.target.duration;
}, false);
v1.addEventListener("loadedmetadata", mediaLoadedmetadata, false);
v1.addEventListener("ended", mediaEnded, false);
v1.load();