Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Update comments in `AudioStreamPlaybackPlaylist::mix` to make the `fade_buffer` fix clearer.

Lukas Tenbrink82c4ac5cd951
diff --git a/modules/interactive_music/audio_stream_playlist.cpp b/modules/interactive_music/audio_stream_playlist.cpp
index 6dd44a5911a..1475d293ad7 100644
--- a/modules/interactive_music/audio_stream_playlist.cpp
+++ b/modules/interactive_music/audio_stream_playlist.cpp
@@ -322,11 +322,12 @@ int AudioStreamPlaybackPlaylist::mix(AudioFrame *p_buffer, float p_rate_scale, i
}
fade_index = -1;
} else {
+ // Index i was already mixed but will be accessed later already, so set it to 0.
+ fade_buffer[i] = AudioFrame(0.0, 0.0);
// Move remaining mixed data to fade buffer.
for (int j = i + 1; j < to_mix; j++) {
fade_buffer[j] = mix_buffer[j];
}
- fade_buffer[i] = AudioFrame(0.0, 0.0);
fade_index = prev;
fade_volume = 1.0;