[Linux] Process TTS callback on the main thread to avoid speech-dispatcher deadlock.

This commit is contained in:
bruvzg 2023-02-21 10:45:49 +02:00
parent 6cde3fac32
commit 6e76a7fbd8
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
2 changed files with 81 additions and 62 deletions

View file

@ -45,7 +45,8 @@
#include <libspeechd.h>
#endif
class TTS_Linux {
class TTS_Linux : public Object {
GDCLASS(TTS_Linux, Object);
_THREAD_SAFE_CLASS_
List<DisplayServer::TTSUtterance> queue;
@ -63,6 +64,11 @@ class TTS_Linux {
static TTS_Linux *singleton;
protected:
static void _bind_methods();
void _speech_event(size_t p_msg_id, size_t p_client_id, int p_type);
void _speech_index_mark(size_t p_msg_id, size_t p_client_id, int p_type, const String &p_index_mark);
public:
static TTS_Linux *get_singleton();