Merge pull request #83779 from AThousandShips/audio_pause

[Audio] Fix pausing stream on entering tree
This commit is contained in:
Rémi Verschelde 2023-10-23 12:41:41 +02:00
commit 8f16d5f504
No known key found for this signature in database
GPG Key ID: C3336907360768E1
3 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
if (autoplay && !Engine::get_singleton()->is_editor_hint()) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
play(); play();
} }
set_stream_paused(false); set_stream_paused(!can_process());
} break; } break;
case NOTIFICATION_EXIT_TREE: { case NOTIFICATION_EXIT_TREE: {

View File

@ -245,7 +245,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
if (autoplay && !Engine::get_singleton()->is_editor_hint()) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
play(); play();
} }
set_stream_paused(false); set_stream_paused(!can_process());
} break; } break;
case NOTIFICATION_EXIT_TREE: { case NOTIFICATION_EXIT_TREE: {

View File

@ -40,7 +40,7 @@ void AudioStreamPlayer::_notification(int p_what) {
if (autoplay && !Engine::get_singleton()->is_editor_hint()) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) {
play(); play();
} }
set_stream_paused(false); set_stream_paused(!can_process());
} break; } break;
case NOTIFICATION_INTERNAL_PROCESS: { case NOTIFICATION_INTERNAL_PROCESS: {