From a7ce7b1d3fdda49d6616dfff0bfdebeeb66170e4 Mon Sep 17 00:00:00 2001 From: Micky Date: Mon, 5 Sep 2022 16:37:15 +0200 Subject: Fix AudioStreamPlayer not resuming after returning to SceneTree --- scene/audio/audio_stream_player.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/audio') diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 04feb0dc6f..03115e765f 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -40,6 +40,7 @@ void AudioStreamPlayer::_notification(int p_what) { if (autoplay && !Engine::get_singleton()->is_editor_hint()) { play(); } + set_stream_paused(false); } break; case NOTIFICATION_INTERNAL_PROCESS: { @@ -64,6 +65,10 @@ void AudioStreamPlayer::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { + set_stream_paused(true); + } break; + + case NOTIFICATION_PREDELETE: { for (Ref &playback : stream_playbacks) { AudioServer::get_singleton()->stop_playback_stream(playback); } -- cgit v1.2.3