diff options
Diffstat (limited to 'servers/audio/audio_server_sw.cpp')
-rw-r--r-- | servers/audio/audio_server_sw.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp index 417a582da6..500886d73a 100644 --- a/servers/audio/audio_server_sw.cpp +++ b/servers/audio/audio_server_sw.cpp @@ -659,7 +659,7 @@ bool AudioServerSW::voice_is_active(RID p_voice) const { RID AudioServerSW::audio_stream_create(AudioStream *p_stream) { - AUDIO_LOCK + AUDIO_LOCK Stream *s = memnew(Stream); s->audio_stream=p_stream; s->event_stream=NULL; @@ -693,11 +693,11 @@ void AudioServerSW::stream_set_active(RID p_stream, bool p_active) { Stream *s = stream_owner.get(p_stream); ERR_FAIL_COND(!s); + _THREAD_SAFE_METHOD_ if (s->active==p_active) return; AUDIO_LOCK; - _THREAD_SAFE_METHOD_ s->active=p_active; if (p_active) s->E=active_audio_streams.push_back(s); @@ -705,6 +705,8 @@ void AudioServerSW::stream_set_active(RID p_stream, bool p_active) { active_audio_streams.erase(s->E); s->E=NULL; } + + } bool AudioServerSW::stream_is_active(RID p_stream) const { @@ -763,7 +765,6 @@ void AudioServerSW::free(RID p_id) { void AudioServerSW::_thread_func(void *self) { - AudioServerSW *as=(AudioServerSW *)self; while (!as->exit_update_thread) { @@ -806,6 +807,7 @@ void AudioServerSW::init() { #ifndef NO_THREADS exit_update_thread=false; thread = Thread::create(_thread_func,this); + thread->set_name("AudioServerSW"); #endif } |