Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r228321 - [GStreamer][WebAudio] Winamp2-js woes
https://bugs.webkit.org/show_bug.cgi?id=182612 Reviewed by Xabier Rodriguez Calvar and Carlos Alberto Lopez Perez. Source/WebCore: Test: webaudio/silence-after-playback.html * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::copyGStreamerBuffersToAudioChannel): Clear the bus if the adapter can't provide enough data. This prevents a nasty noise after playing songs in Winamp. (WebCore::AudioSourceProviderGStreamer::setClient): No need to set the client more than once, this fixes runtime warnings. LayoutTests: * webaudio/silence-after-playback-expected.wav: Added. * webaudio/silence-after-playback.html: Added.
- Loading branch information
1 parent
1b31cb5
commit 4a495e7
Showing
6 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test.js"></script> | ||
<script src="resources/audio-testing.js"></script> | ||
</head> | ||
|
||
<body> | ||
<div id="description"></div> | ||
<div id="console"></div> | ||
|
||
<script> | ||
description("Test ensuring silence is output after <audio> playback ended."); | ||
|
||
let context = 0; | ||
const sampleRate = 44100.0; | ||
const lengthInSeconds = 3; | ||
|
||
function ended() { | ||
context.startRendering(); | ||
context.oncomplete = finishAudioTest; | ||
} | ||
|
||
function runTest() { | ||
context = new webkitOfflineAudioContext(2, sampleRate * lengthInSeconds, sampleRate); | ||
|
||
audioElement = new Audio(); | ||
audioElement.src = "resources/media/128kbps-44khz.mp3"; | ||
document.body.appendChild(audioElement); | ||
|
||
mediaSource = context.createMediaElementSource(audioElement); | ||
window.audioNode = mediaSource; | ||
|
||
mediaSource.connect(context.destination); | ||
|
||
audioElement.play(); | ||
audioElement.addEventListener("ended", ended, true); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
runTest(); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters