summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2018-07-11 14:37:07 -0300
committerGitHub <noreply@github.com>2018-07-11 14:37:07 -0300
commit11c36a939d6eab3d0639b0e3f2f7248d250740ca (patch)
tree7fb181e16f34ac739f0357a7be2acc9a3417c74a
parent1b78b664cbdf55c52a1de421cbfa7253667ac84e (diff)
parent0c78a58b6472f704d473e0307c9ea83dfbde1811 (diff)
Merge pull request #20093 from marcelofg55/audio_stream2d
Fix possible bug with AudioStreamPlayer2D audio position
-rw-r--r--scene/2d/audio_stream_player_2d.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 4dbcd6c609..507499a324 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -304,6 +304,11 @@ float AudioStreamPlayer2D::get_pitch_scale() const {
void AudioStreamPlayer2D::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()) {
setplay = p_from_pos;
output_ready = false;