diff options
author | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-07-10 22:57:50 -0300 |
---|---|---|
committer | Marcelo Fernandez <marcelofg55@gmail.com> | 2018-07-10 22:57:50 -0300 |
commit | 0c78a58b6472f704d473e0307c9ea83dfbde1811 (patch) | |
tree | 31b3af26cd98ba72756ffdee9c50737464976988 | |
parent | a184126e8b2a74b47137b47001c1d11a092ccdaa (diff) |
Fix possible bug with AudioStreamPlayer2D audio position
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 5 |
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; |