Let playback ticks catch up, and let go of decoded audio nothing holds
While busy only one tick ran a pass, so drawing slower than the tick rate played animations in slow motion with a growing backlog. Recording takes its time from the recorder, so every pass now runs the ticks owed (still at most TICK_DELTA_MAX_MS of them). Decoded sounds were kept for the session. Every few seconds, those no open document or library holds are released once they stop playing.
This commit is contained in:
1 parent
e963bc50d3
commit
9e193a3d5c
5 files changed
+33
-6
No files matched your search
@@ -389,6 +389,10 @@ TEST_CASE("audio decodes and mixes")
|
||||
REQUIRE(mix.size() > start + 2);
|
||||
CHECK(mix[start - 2] == 0.0f);
|
||||
CHECK(mix[start + 2] == doctest::Approx(0.5f).epsilon(0.05));
|
||||
|
||||
// A sound let go of decodes again when it's next needed.
|
||||
audio_prune({});
|
||||
CHECK(audio_mix({{}, {&sound}}, 30) == mix);
|
||||
}
|
||||
|
||||
// A second editor hands its paths to the first, which has them queued once it answers, and wakes its event loop.
|
||||
|
||||
Reference in new issue
Block a user