diff options
Diffstat (limited to 'scene/3d/audio_stream_player_3d.cpp')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 6efdf25f0d..1ad36102ba 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -555,12 +555,12 @@ void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { stream = p_stream; stream_playback = p_stream->instance_playback(); + AudioServer::get_singleton()->unlock(); + if (stream_playback.is_null()) { stream.unref(); ERR_FAIL_COND(stream_playback.is_null()); } - - AudioServer::get_singleton()->unlock(); } Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { |