Audio: Check if on tree before calling can_process()
This commit is contained in:
parent
5f9a510441
commit
46e07a8b01
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue