Merge pull request #46151 from ellenhp/fix_spatial_player_play
Fix a pop on play() in AudioStreamPlayer2D and 3D
This commit is contained in:
commit
9d84e3b395
@ -311,7 +311,6 @@ void AudioStreamPlayer2D::play(float p_from_pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
active = true;
|
|
||||||
setplay = p_from_pos;
|
setplay = p_from_pos;
|
||||||
output_ready = false;
|
output_ready = false;
|
||||||
set_physics_process_internal(true);
|
set_physics_process_internal(true);
|
||||||
@ -334,7 +333,7 @@ void AudioStreamPlayer2D::stop() {
|
|||||||
|
|
||||||
bool AudioStreamPlayer2D::is_playing() const {
|
bool AudioStreamPlayer2D::is_playing() const {
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
return active; // && stream_playback->is_playing();
|
return active || setplay >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -683,7 +683,6 @@ void AudioStreamPlayer3D::play(float p_from_pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
active = true;
|
|
||||||
setplay = p_from_pos;
|
setplay = p_from_pos;
|
||||||
output_ready = false;
|
output_ready = false;
|
||||||
set_physics_process_internal(true);
|
set_physics_process_internal(true);
|
||||||
@ -706,7 +705,7 @@ void AudioStreamPlayer3D::stop() {
|
|||||||
|
|
||||||
bool AudioStreamPlayer3D::is_playing() const {
|
bool AudioStreamPlayer3D::is_playing() const {
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
return active; // && stream_playback->is_playing();
|
return active || setplay >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user