From 159992f66339bf1e8fae8a79f65ab0fa3e84f7a8 Mon Sep 17 00:00:00 2001 From: hoontee <5272529+hoontee@users.noreply.github.com> Date: Thu, 7 May 2020 02:23:50 -0500 Subject: [PATCH] Fix bug with AudioStreamPlayer3D audio position Applies https://github.com/godotengine/godot/commit/0c78a58b6472f704d473e0307c9ea83dfbde1811 to `AudioStreamPlayer3D::play`. (cherry picked from commit 330bd686ab6068f51b536d7f351a8c6641300749) --- scene/3d/audio_stream_player_3d.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 0250c78bea8..6f6d9b9bee7 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -701,6 +701,11 @@ float AudioStreamPlayer3D::get_pitch_scale() const { void AudioStreamPlayer3D::play(float p_from_pos) { + if (!is_playing()) { + // Reset the prev_output_count if the stream is stopped + prev_output_count = 0; + } + if (stream_playback.is_valid()) { active = true; setplay = p_from_pos;