Title: [265765] trunk
- Revision
- 265765
- Author
- [email protected]
- Date
- 2020-08-17 12:14:41 -0700 (Mon, 17 Aug 2020)
Log Message
WaveShaperNode should not output silence when it has no input or when input is silence
https://bugs.webkit.org/show_bug.cgi?id=215574
Reviewed by Eric Carlson.
LayoutTests/imported/w3c:
Rebaseline existing test now that all checks are passing.
* web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs-expected.txt:
Source/WebCore:
WaveShaperNode should not output silence when it has no input or when input is silence.
It should still apply its curve to the silent input.
No new tests, rebaselined existing test.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::disableOutputsIfNecessary):
Do not disable the WaveShaperNode's output when its has no input. The WaveShaperNode
may still provide non-silent output when it has no input.
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::propagatesSilence const):
* Modules/webaudio/WaveShaperNode.h:
Override propagatesSilence() to return false when the WaveShaperNode has a curve to apply,
so that we ask the node to process the input even when it is silence.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (265764 => 265765)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-08-17 19:14:41 UTC (rev 265765)
@@ -1,3 +1,14 @@
+2020-08-17 Chris Dumez <[email protected]>
+
+ WaveShaperNode should not output silence when it has no input or when input is silence
+ https://bugs.webkit.org/show_bug.cgi?id=215574
+
+ Reviewed by Eric Carlson.
+
+ Rebaseline existing test now that all checks are passing.
+
+ * web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs-expected.txt:
+
2020-08-17 Yusuke Suzuki <[email protected]>
JSDOMConstructorNotConstructable should be a constructor
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs-expected.txt (265764 => 265765)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs-expected.txt 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-waveshapernode-interface/silent-inputs-expected.txt 2020-08-17 19:14:41 UTC (rev 265765)
@@ -5,31 +5,13 @@
PASS Executing "test-2"
PASS Audit report
PASS > [test-0] curve output is non-zero for silent inputs
-FAIL X WaveShaper with silent inputs and curve {"0":0.5,"1":0.5,"2":0.5}: Expected 0.5 for all values but found 16000 unexpected values:
- Index Actual
- [0] 0
- [1] 0
- [2] 0
- [3] 0
- ...and 15996 more errors. assert_true: expected true got false
-FAIL < [test-0] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS WaveShaper with silent inputs and curve {"0":0.5,"1":0.5,"2":0.5} contains only the constant 0.5.
+PASS < [test-0] All assertions passed. (total 1 assertions)
PASS > [test-1] 2x curve output is non-zero for silent inputs
-FAIL X WaveShaper with 2x oversample, silent inputs, and curve {"0":0.5,"1":0.5,"2":0.5}: Expected 0.5 for all values but found 16000 unexpected values:
- Index Actual
- [0] 0
- [1] 0
- [2] 0
- [3] 0
- ...and 15996 more errors. assert_true: expected true got false
-FAIL < [test-1] 1 out of 1 assertions were failed. assert_true: expected true got false
+PASS WaveShaper with 2x oversample, silent inputs, and curve {"0":0.5,"1":0.5,"2":0.5} contains only the constant 0.5.
+PASS < [test-1] All assertions passed. (total 1 assertions)
PASS > [test-2] curve output is non-zero for no inputs
-FAIL X WaveShaper with no inputs and curve {"0":0.5,"1":0.5,"2":0.5}: Expected 0.5 for all values but found 16000 unexpected values:
- Index Actual
- [0] 0
- [1] 0
- [2] 0
- [3] 0
- ...and 15996 more errors. assert_true: expected true got false
-FAIL < [test-2] 1 out of 1 assertions were failed. assert_true: expected true got false
-FAIL # AUDIT TASK RUNNER FINISHED: 3 out of 3 tasks were failed. assert_true: expected true got false
+PASS WaveShaper with no inputs and curve {"0":0.5,"1":0.5,"2":0.5} contains only the constant 0.5.
+PASS < [test-2] All assertions passed. (total 1 assertions)
+PASS # AUDIT TASK RUNNER FINISHED: 3 tasks ran successfully.
Modified: trunk/Source/WebCore/ChangeLog (265764 => 265765)
--- trunk/Source/WebCore/ChangeLog 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/Source/WebCore/ChangeLog 2020-08-17 19:14:41 UTC (rev 265765)
@@ -1,3 +1,26 @@
+2020-08-17 Chris Dumez <[email protected]>
+
+ WaveShaperNode should not output silence when it has no input or when input is silence
+ https://bugs.webkit.org/show_bug.cgi?id=215574
+
+ Reviewed by Eric Carlson.
+
+ WaveShaperNode should not output silence when it has no input or when input is silence.
+ It should still apply its curve to the silent input.
+
+ No new tests, rebaselined existing test.
+
+ * Modules/webaudio/AudioNode.cpp:
+ (WebCore::AudioNode::disableOutputsIfNecessary):
+ Do not disable the WaveShaperNode's output when its has no input. The WaveShaperNode
+ may still provide non-silent output when it has no input.
+
+ * Modules/webaudio/WaveShaperNode.cpp:
+ (WebCore::WaveShaperNode::propagatesSilence const):
+ * Modules/webaudio/WaveShaperNode.h:
+ Override propagatesSilence() to return false when the WaveShaperNode has a curve to apply,
+ so that we ask the node to process the input even when it is silence.
+
2020-08-17 David Kilzer <[email protected]>
Clean up DragApplicationFlags after switch to OptionSet<>
Modified: trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp (265764 => 265765)
--- trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/Source/WebCore/Modules/webaudio/AudioNode.cpp 2020-08-17 19:14:41 UTC (rev 265765)
@@ -423,7 +423,9 @@
// because they no longer have any input connections. This needs to be handled more generally where AudioNodes have
// a tailTime attribute. Then the AudioNode only needs to remain "active" for tailTime seconds after there are no
// longer any active connections.
- if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) {
+ // Also, WaveShaperNode may produce non-silence even when it no longer has any output. For this reason, we cannot
+ // disable it either.
+ if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay && nodeType() != NodeTypeWaveShaper) {
m_isDisabled = true;
for (auto& output : m_outputs)
output->disable();
Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp (265764 => 265765)
--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp 2020-08-17 19:14:41 UTC (rev 265765)
@@ -132,6 +132,12 @@
return OverSampleType::None;
}
+bool WaveShaperNode::propagatesSilence() const
+{
+ auto curve = const_cast<WaveShaperNode*>(this)->curve();
+ return !curve || !curve->length();
+}
+
} // namespace WebCore
#endif // ENABLE(WEB_AUDIO)
Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h (265764 => 265765)
--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h 2020-08-17 19:08:28 UTC (rev 265764)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h 2020-08-17 19:14:41 UTC (rev 265765)
@@ -51,6 +51,8 @@
private:
explicit WaveShaperNode(BaseAudioContext&);
+ bool propagatesSilence() const final;
+
WaveShaperProcessor* waveShaperProcessor() { return static_cast<WaveShaperProcessor*>(processor()); }
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes