From 55ea4a81774ea90901fcc1a2cf7c75deba9d3156 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 30 Dec 2019 20:17:02 +1100 Subject: [PATCH] implemented minor audio keyframing optimization Since updating all input values per sample could be performance costly, we now only update inputs that are either keyframing or connected to another node --- app/render/backend/audio/audioworker.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/render/backend/audio/audioworker.cpp b/app/render/backend/audio/audioworker.cpp index 235573be4..7c2a33d97 100644 --- a/app/render/backend/audio/audioworker.cpp +++ b/app/render/backend/audio/audioworker.cpp @@ -49,8 +49,11 @@ void AudioWorker::RunNodeAccelerated(const Node *node, const TimeRange &range, c && param != node->ProcessesSamplesFrom()) { NodeInput* input = static_cast(param); - input_params.Insert(input, ProcessInput(input, - TimeRange(this_sample_time, this_sample_time))); + // If the input isn't keyframing, we don't need to update it unless it's connected, in which case it may change + if (input->IsConnected() || input->is_keyframing()) { + input_params.Insert(input, ProcessInput(input, + TimeRange(this_sample_time, this_sample_time))); + } } }