зеркало из https://github.com/mozilla/gecko-dev.git
Bug 461281 - CPU usage goes to 100% after playing some Ogg files - r+sr=roc
This commit is contained in:
Родитель
bce5783046
Коммит
537d9b92af
|
@ -79,7 +79,7 @@ size_t nsChannelReader::io_read(char* aBuffer, size_t aCount)
|
||||||
{
|
{
|
||||||
PRUint32 bytes = 0;
|
PRUint32 bytes = 0;
|
||||||
nsresult rv = mStream.Read(aBuffer, aCount, &bytes);
|
nsresult rv = mStream.Read(aBuffer, aCount, &bytes);
|
||||||
if (!NS_SUCCEEDED(rv) || bytes == 0) {
|
if (!NS_SUCCEEDED(rv)) {
|
||||||
return static_cast<size_t>(OGGZ_ERR_SYSTEM);
|
return static_cast<size_t>(OGGZ_ERR_SYSTEM);
|
||||||
}
|
}
|
||||||
mCurrentPosition += bytes;
|
mCurrentPosition += bytes;
|
||||||
|
|
|
@ -44,6 +44,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
_TEST_FILES = test_autoplay.html \
|
_TEST_FILES = test_autoplay.html \
|
||||||
|
test_bug461281.html \
|
||||||
test_constants.html \
|
test_constants.html \
|
||||||
test_controls.html \
|
test_controls.html \
|
||||||
test_currentTime.html \
|
test_currentTime.html \
|
||||||
|
@ -68,6 +69,7 @@ _TEST_FILES = test_autoplay.html \
|
||||||
test_timeupdate3.html \
|
test_timeupdate3.html \
|
||||||
test_volume.html \
|
test_volume.html \
|
||||||
320x240.ogg \
|
320x240.ogg \
|
||||||
|
bug461281.ogg \
|
||||||
seek.ogg \
|
seek.ogg \
|
||||||
# test_bug448534.html \
|
# test_bug448534.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Media test: Bug 461281 - Ogg Streams with eof marker</title>
|
||||||
|
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
|
||||||
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<video id='v'
|
||||||
|
src='bug461281.ogg'
|
||||||
|
onloadedmetadata='return startTest();'
|
||||||
|
onended='return playbackEnded();'></video>
|
||||||
|
<pre id="test">
|
||||||
|
<script class="testbody" type="text/javascript">
|
||||||
|
// Test if the ended event occurs with media without an eos marker
|
||||||
|
var v = document.getElementById('v');
|
||||||
|
var endPassed = false;
|
||||||
|
var completed = false;
|
||||||
|
var timeout;
|
||||||
|
|
||||||
|
function startTest() {
|
||||||
|
if (completed)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
v.play();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function playbackEnded() {
|
||||||
|
if (completed)
|
||||||
|
return false
|
||||||
|
|
||||||
|
completed = true;
|
||||||
|
ok(v.ended, "Checking playback has ended");
|
||||||
|
clearTimeout(timeout);
|
||||||
|
SimpleTest.finish();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
timeout = setTimeout(function () {
|
||||||
|
ok(false, "Test timed out");
|
||||||
|
SimpleTest.finish();
|
||||||
|
}, 30000);
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
Загрузка…
Ссылка в новой задаче