talk: Force-shutdown the voice system before loading a new voice

Otherwise we might actually be talking when we try to switch, or
otherwise trash the state of the running talk thread, leading to
memory corruption or an outright crash

(This fixes a panic observed on the xDuoo X3)

Change-Id: I78e4232085c5c160c9ee4f18167dad8dad2b9287
This commit is contained in:
Solomon Peachy 2020-07-23 23:27:49 -04:00
parent 0c4ae417d5
commit 09f40e266b

View file

@ -919,6 +919,9 @@ void talk_init(void)
#endif /* CONFIG_CODEC == SWCODEC */
mutex_init(&read_buffer_mutex);
}
talk_force_shutup(); /* In case we have something speaking! */
talk_initialized = true;
strlcpy((char *)last_lang, (char *)global_settings.lang_file,
MAX_FILENAME);