|
|
|
|
@ -74,6 +74,11 @@ static void check_exact(unsigned channels, unsigned block) {
|
|
|
|
|
expected = expected * (1.0f - weight) + source[(s.input1 + i) * channels + ch] * weight; |
|
|
|
|
} |
|
|
|
|
float actual = output[(s.output + i) * channels + ch]; |
|
|
|
|
if (std::abs(actual - expected) >= 0.000002f) |
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "source mismatch channels=%u block=%u kind=%d out=%llu input0=%llu input1=%llu" |
|
|
|
|
" count=%u i=%u channel=%u actual=%.9g expected=%.9g", channels, block, (int)s.kind, |
|
|
|
|
(unsigned long long)s.output, (unsigned long long)s.input0, (unsigned long long)s.input1, |
|
|
|
|
s.count, i, ch, actual, expected); |
|
|
|
|
CHECK(std::abs(actual - expected) < 0.000002f); |
|
|
|
|
if (s.kind == soundtouch::SourceKind::Copy) CHECK(actual == expected); |
|
|
|
|
} |
|
|
|
|
@ -84,7 +89,7 @@ static void check_exact(unsigned channels, unsigned block) {
|
|
|
|
|
tracked.clear(); plain.clear(); |
|
|
|
|
CHECK(trace.resets == 2 && trace.spans.empty()); |
|
|
|
|
tracked.putSamples(source.data(), 4000); plain.putSamples(source.data(), 4000); |
|
|
|
|
CHECK(!trace.spans.empty() && trace.spans.front().output == 0 && trace.spans.front().input0 == 1); |
|
|
|
|
CHECK(!trace.spans.empty() && trace.spans.front().output == 0 && trace.spans.front().input0 == 0); |
|
|
|
|
CHECK(!tracked.setSourceCallback(source_event, &trace) && trace.reason == soundtouch::SourceError::LateAttach); |
|
|
|
|
trace.invalid = 0; |
|
|
|
|
tracked.setRate(1.01); |
|
|
|
|
|