From 8a426923c21e8a9873d046c650a90366e89821fa Mon Sep 17 00:00:00 2001 From: Ellen Poe Date: Wed, 17 Feb 2021 19:09:42 -0800 Subject: [PATCH] Fix pops in play() of both spatial audio players (cherry picked from commit 5e1442ad55f4e21e8bfca45890369c23c1887c49) --- scene/2d/audio_stream_player_2d.cpp | 3 +-- 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 7dfc35ed958..e9348b4c0f7 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -323,7 +323,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); @@ -349,7 +348,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 39f090d55ef..474a0b0ccdc 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -707,7 +707,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); @@ -733,7 +732,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;