Skip to content

Commit

Permalink
Set active in physics thread instead of play() function
Browse files Browse the repository at this point in the history
Fixes pops after calling `set_stream()`
  • Loading branch information
Waridley committed Feb 2, 2021
1 parent 9620c1c commit fda7066
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scene/2d/audio_stream_player_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ void AudioStreamPlayer2D::play(float p_from_pos) {
}

if (stream_playback.is_valid()) {
active = true;
//active = true; // setseek needs set *before* active, but that is done in the physics thread
setplay = p_from_pos;
output_ready = false;
set_physics_process_internal(true);
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/audio_stream_player_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ void AudioStreamPlayer3D::play(float p_from_pos) {
}

if (stream_playback.is_valid()) {
active = true;
//active = true; // setseek needs set *before* active, but that is done in the physics thread
setplay = p_from_pos;
output_ready = false;
set_physics_process_internal(true);
Expand Down

0 comments on commit fda7066

Please sign in to comment.