diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-18 10:12:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 10:12:13 +0100 |
commit | 9d84e3b395631f1ffc27813c0d25bc41f655fb08 (patch) | |
tree | 8ab8ce110425ecb495b818411e34d602bafe6841 | |
parent | 81fc37b1ff98935eb36f52ffaba18659827816b4 (diff) | |
parent | 5e1442ad55f4e21e8bfca45890369c23c1887c49 (diff) |
Merge pull request #46151 from ellenhp/fix_spatial_player_play
Fix a pop on play() in AudioStreamPlayer2D and 3D
-rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 3 | ||||
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index d6f35cc99d..79624bf3bf 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -311,7 +311,6 @@ void AudioStreamPlayer2D::play(float p_from_pos) { } if (stream_playback.is_valid()) { - active = true; setplay = p_from_pos; output_ready = false; set_physics_process_internal(true); @@ -334,7 +333,7 @@ void AudioStreamPlayer2D::stop() { bool AudioStreamPlayer2D::is_playing() const { if (stream_playback.is_valid()) { - return active; // && stream_playback->is_playing(); + return active || setplay >= 0; } return false; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 65d0703139..dd77221a3f 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -683,7 +683,6 @@ void AudioStreamPlayer3D::play(float p_from_pos) { } if (stream_playback.is_valid()) { - active = true; setplay = p_from_pos; output_ready = false; set_physics_process_internal(true); @@ -706,7 +705,7 @@ void AudioStreamPlayer3D::stop() { bool AudioStreamPlayer3D::is_playing() const { if (stream_playback.is_valid()) { - return active; // && stream_playback->is_playing(); + return active || setplay >= 0; } return false; |