diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-23 12:41:41 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-23 12:41:41 +0200 |
| commit | 8f16d5f504d47e10d947bff0d98eff7660d3b21a (patch) | |
| tree | fbda5a43fd63bf38bab2a8f9601c0fdb95296706 | |
| parent | 943b7419cb0a189f2863443fe7ddbaba1787653a (diff) | |
| parent | 72fccd82c556b6f0d9678fc12eb8c331ff86d9f4 (diff) | |
| download | redot-engine-8f16d5f504d47e10d947bff0d98eff7660d3b21a.tar.gz | |
Merge pull request #83779 from AThousandShips/audio_pause
[Audio] Fix pausing stream on entering tree
| -rw-r--r-- | scene/2d/audio_stream_player_2d.cpp | 2 | ||||
| -rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 2 | ||||
| -rw-r--r-- | scene/audio/audio_stream_player.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp index 0a80467b6b..afc5748ac5 100644 --- a/scene/2d/audio_stream_player_2d.cpp +++ b/scene/2d/audio_stream_player_2d.cpp @@ -43,7 +43,7 @@ void AudioStreamPlayer2D::_notification(int p_what) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } - set_stream_paused(false); + set_stream_paused(!can_process()); } break; case NOTIFICATION_EXIT_TREE: { diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 9f99b5ecbd..3971e615a1 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -245,7 +245,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } - set_stream_paused(false); + set_stream_paused(!can_process()); } break; case NOTIFICATION_EXIT_TREE: { diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 7f6dfd0ab8..f3c986f9b3 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -40,7 +40,7 @@ void AudioStreamPlayer::_notification(int p_what) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } - set_stream_paused(false); + set_stream_paused(!can_process()); } break; case NOTIFICATION_INTERNAL_PROCESS: { |
