Audio: Check if on tree before calling can_process()

This commit is contained in:
sigmund68k 2026-01-14 16:11:08 -05:00 committed by Rémi Verschelde
parent 5f9a510441
commit 46e07a8b01
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -114,7 +114,8 @@ void AudioStreamPlayerInternal::notification(int p_what) {
case Node::NOTIFICATION_SUSPENDED:
case Node::NOTIFICATION_PAUSED: {
if (!node->can_process()) {
bool can_process = node->is_inside_tree() && node->can_process();
if (!can_process) {
// Node can't process so we start fading out to silence
set_stream_paused(true);
}