summaryrefslogtreecommitdiffstats
path: root/scene/animation/animation_tree.cpp
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-02-06 23:15:48 +0300
committerGitHub <noreply@github.com>2023-02-06 23:15:48 +0300
commit5964e4c202980f5530bc62d448962c6e71f4dcb5 (patch)
tree178bf0cdc3b14a623d095df7b62bee759b7cd6ea /scene/animation/animation_tree.cpp
parent7b86a082be918631c7024ba9a516bd3388e18995 (diff)
parentb9b81304327bb6c47545c7036cf95baa01a39a09 (diff)
downloadredot-engine-5964e4c202980f5530bc62d448962c6e71f4dcb5.tar.gz
Merge pull request #72727 from TokageItLab/fix-audio-retrieve
Fixed animation audio to play considering time when seeking
Diffstat (limited to 'scene/animation/animation_tree.cpp')
-rw-r--r--scene/animation/animation_tree.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp
index dd5bf31c66..8b1a5e3aac 100644
--- a/scene/animation/animation_tree.cpp
+++ b/scene/animation/animation_tree.cpp
@@ -1546,6 +1546,10 @@ void AnimationTree::_process_graph(double p_delta) {
double end_ofs = a->audio_track_get_key_end_offset(i, idx);
double len = stream->get_length();
+ if (seeked) {
+ start_ofs += time - a->track_get_key_time(i, idx);
+ }
+
if (t->object->call(SNAME("get_stream")) != t->audio_stream) {
t->object->call(SNAME("set_stream"), t->audio_stream);
t->audio_stream_playback.unref();