Bug 1308435 - Make setting the value attribute of an AudioParam strictly equivalent of calling setValueAtTime with AudioContext.currentTime. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D225219
This commit is contained in:
@@ -482,7 +482,6 @@ void AudioEventTimeline::GetValuesAtTimeHelperInternal(
|
||||
case AudioTimelineEvent::SetTarget:
|
||||
case AudioTimelineEvent::SetValueCurve:
|
||||
break;
|
||||
case AudioTimelineEvent::SetValue:
|
||||
case AudioTimelineEvent::Cancel:
|
||||
case AudioTimelineEvent::Track:
|
||||
MOZ_ASSERT(false, "Should have been handled earlier.");
|
||||
@@ -500,7 +499,6 @@ void AudioEventTimeline::GetValuesAtTimeHelperInternal(
|
||||
break;
|
||||
case AudioTimelineEvent::SetTarget:
|
||||
MOZ_FALLTHROUGH_ASSERT("AudioTimelineEvent::SetTarget");
|
||||
case AudioTimelineEvent::SetValue:
|
||||
case AudioTimelineEvent::Cancel:
|
||||
case AudioTimelineEvent::Track:
|
||||
MOZ_ASSERT(false, "Should have been handled earlier.");
|
||||
|
||||
@@ -31,8 +31,8 @@ namespace dom {
|
||||
struct AudioTimelineEvent {
|
||||
MOZ_DEFINE_ENUM_WITH_BASE_AND_TOSTRING_AT_CLASS_SCOPE(
|
||||
Type, uint32_t,
|
||||
(SetValue, SetValueAtTime, LinearRamp, ExponentialRamp, SetTarget,
|
||||
SetValueCurve, Track, Cancel));
|
||||
(SetValueAtTime, LinearRamp, ExponentialRamp, SetTarget, SetValueCurve,
|
||||
Track, Cancel));
|
||||
|
||||
class TimeUnion {
|
||||
public:
|
||||
@@ -313,17 +313,6 @@ class AudioEventTimeline {
|
||||
return mSimpleValue.value();
|
||||
}
|
||||
|
||||
void SetValue(float aValue) {
|
||||
// FIXME: bug 1308435
|
||||
// A spec change means this should instead behave like setValueAtTime().
|
||||
|
||||
// Silently don't change anything if there are any events
|
||||
if (mEvents.IsEmpty()) {
|
||||
mSetTargetStartValue = mDefaultValue = aValue;
|
||||
mSimpleValue = Some(aValue);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename TimeType>
|
||||
void CancelScheduledValues(TimeType aStartTime) {
|
||||
for (unsigned i = 0; i < mEvents.Length(); ++i) {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define AudioParam_h_
|
||||
|
||||
#include "AudioParamTimeline.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "AudioNode.h"
|
||||
@@ -58,27 +59,12 @@ class AudioParam final : public nsWrapperCache, public AudioParamTimeline {
|
||||
|
||||
// Intended for use in AudioNode creation, when the setter should not throw.
|
||||
void SetInitialValue(float aValue) {
|
||||
MOZ_ASSERT(HasSimpleValue(), "Existing events unexpected");
|
||||
AudioParamEvent event(AudioTimelineEvent::SetValue, 0.0f, aValue);
|
||||
|
||||
DebugOnly<ErrorResult> rv;
|
||||
MOZ_ASSERT(ValidateEvent(event, rv), "This event should be valid");
|
||||
|
||||
AudioParamTimeline::SetValue(aValue);
|
||||
|
||||
SendEventToEngine(event);
|
||||
IgnoredErrorResult rv;
|
||||
SetValue(aValue, rv);
|
||||
}
|
||||
|
||||
void SetValue(float aValue, ErrorResult& aRv) {
|
||||
AudioParamEvent event(AudioTimelineEvent::SetValue, 0.0f, aValue);
|
||||
|
||||
if (!ValidateEvent(event, aRv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AudioParamTimeline::SetValue(aValue);
|
||||
|
||||
SendEventToEngine(event);
|
||||
SetValueAtTime(aValue, GetParentObject()->CurrentTime(), aRv);
|
||||
}
|
||||
|
||||
AudioParam* SetValueAtTime(float aValue, double aStartTime,
|
||||
|
||||
@@ -64,10 +64,6 @@ class AudioParamTimeline : public AudioEventTimeline {
|
||||
mTrack = aEvent.mTrack;
|
||||
return;
|
||||
}
|
||||
if (aEvent.mType == AudioTimelineEvent::SetValue) {
|
||||
AudioEventTimeline::SetValue(aEvent.NominalValue());
|
||||
return;
|
||||
}
|
||||
AudioEventTimeline::InsertEvent<TimeType>(aEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[test-analyser-resume-after-suspended.html]
|
||||
expected:
|
||||
if (os == "mac") and debug: [OK, TIMEOUT]
|
||||
if os == "linux": ERROR
|
||||
if os == "linux": [ERROR, TIMEOUT]
|
||||
[AnalyserNode resume after suspended]
|
||||
expected:
|
||||
if (os == "mac") and debug: [PASS, TIMEOUT]
|
||||
if os == "linux": TIMEOUT
|
||||
if os == "linux": [PASS, TIMEOUT]
|
||||
|
||||
@@ -30,3 +30,33 @@
|
||||
|
||||
[< [StereoPanner\] 8 out of 8 assertions were failed.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[0:128\]: Expected 2 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t2.9990234375\n\t[2\]\t3.998046875\n\t[3\]\t4.9970703125\n\t[4\]\t5.99609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[128:256\]: Expected 129.875 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t130.8740234375\n\t[2\]\t131.873046875\n\t[3\]\t132.8720703125\n\t[4\]\t133.87109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[256:384\]: Expected 257.75 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t258.7490234375\n\t[2\]\t259.748046875\n\t[3\]\t260.7470703125\n\t[4\]\t261.74609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[384:512\]: Expected 385.625 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t386.6240234375\n\t[2\]\t387.623046875\n\t[3\]\t388.6220703125\n\t[4\]\t389.62109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[512:640\]: Expected 513.5 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t514.4990234375\n\t[2\]\t515.498046875\n\t[3\]\t516.4970703125\n\t[4\]\t517.49609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[640:768\]: Expected 641.375 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t642.3740234375\n\t[2\]\t643.373046875\n\t[3\]\t644.3720703125\n\t[4\]\t645.37109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[768:896\]: Expected 769.25 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t770.2490234375\n\t[2\]\t771.248046875\n\t[3\]\t772.2470703125\n\t[4\]\t773.24609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X gain[896:1024\]: Expected 897.125 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t898.1240234375\n\t[2\]\t899.123046875\n\t[3\]\t900.1220703125\n\t[4\]\t901.12109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[< [Gain\] 8 out of 8 assertions were failed.]
|
||||
expected: FAIL
|
||||
|
||||
[# AUDIT TASK RUNNER FINISHED: 2 out of 2 tasks were failed.]
|
||||
expected: FAIL
|
||||
|
||||
@@ -48,3 +48,33 @@
|
||||
|
||||
[X k-rate ConstantSource.offset: output[384:512\]: Expected 384 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t385\n\t[2\]\t386\n\t[3\]\t387\n\t[4\]\t388\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[0:128\]: Expected 2 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t2.9990234375\n\t[2\]\t3.998046875\n\t[3\]\t4.9970703125\n\t[4\]\t5.99609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[128:256\]: Expected 129.875 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t130.8740234375\n\t[2\]\t131.873046875\n\t[3\]\t132.8720703125\n\t[4\]\t133.87109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[256:384\]: Expected 257.75 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t258.7490234375\n\t[2\]\t259.748046875\n\t[3\]\t260.7470703125\n\t[4\]\t261.74609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[384:512\]: Expected 385.625 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t386.6240234375\n\t[2\]\t387.623046875\n\t[3\]\t388.6220703125\n\t[4\]\t389.62109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[512:640\]: Expected 513.5 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t514.4990234375\n\t[2\]\t515.498046875\n\t[3\]\t516.4970703125\n\t[4\]\t517.49609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[640:768\]: Expected 641.375 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t642.3740234375\n\t[2\]\t643.373046875\n\t[3\]\t644.3720703125\n\t[4\]\t645.37109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[768:896\]: Expected 769.25 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t770.2490234375\n\t[2\]\t771.248046875\n\t[3\]\t772.2470703125\n\t[4\]\t773.24609375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[X ConstantSource.offset k-rate input: output[896:1024\]: Expected 897.125 for all values but found 127 unexpected values: \n\tIndex\tActual\n\t[1\]\t898.1240234375\n\t[2\]\t899.123046875\n\t[3\]\t900.1220703125\n\t[4\]\t901.12109375\n\t...and 123 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
[< [ConstantSource.offset\] 8 out of 8 assertions were failed.]
|
||||
expected: FAIL
|
||||
|
||||
[# AUDIT TASK RUNNER FINISHED: 3 out of 3 tasks were failed.]
|
||||
expected: FAIL
|
||||
|
||||
@@ -13,3 +13,6 @@
|
||||
|
||||
[< [detune limits\] 1 out of 4 assertions were failed.]
|
||||
expected: FAIL
|
||||
|
||||
[X osc[5:\]: Expected 0 for all values but found 5507 unexpected values: \n\tIndex\tActual\n\t[0\]\t0.652276873588562\n\t[1\]\t-0.4830973744392395\n\t[2\]\t0.1254984438419342\n\t[3\]\t-0.8726160526275635\n\t...and 5503 more errors.]
|
||||
expected: FAIL
|
||||
|
||||
Reference in New Issue
Block a user