aboutsummaryrefslogtreecommitdiff
path: root/backends/text-to-speech
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-08-05 00:23:15 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commitbc101179804bddbb312a0e7ec79df3a29605c2ad (patch)
tree1e247fea31f93a69b9cc89f44d3c1c45ee5c91f9 /backends/text-to-speech
parent4036b73b6c5fb776c7bb62209bf6b4fe36771667 (diff)
downloadscummvm-rg350-bc101179804bddbb312a0e7ec79df3a29605c2ad.tar.gz
scummvm-rg350-bc101179804bddbb312a0e7ec79df3a29605c2ad.tar.bz2
scummvm-rg350-bc101179804bddbb312a0e7ec79df3a29605c2ad.zip
TTS: Restart SPD if resume() fails.
Diffstat (limited to 'backends/text-to-speech')
-rw-r--r--backends/text-to-speech/linux/linux-text-to-speech.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/backends/text-to-speech/linux/linux-text-to-speech.cpp b/backends/text-to-speech/linux/linux-text-to-speech.cpp
index 20ba07d74d..cc506db333 100644
--- a/backends/text-to-speech/linux/linux-text-to-speech.cpp
+++ b/backends/text-to-speech/linux/linux-text-to-speech.cpp
@@ -218,8 +218,12 @@ bool LinuxTextToSpeechManager::resume() {
if (_speechQueue.size()) {
_speechState = SPEAKING;
for (Common::List<Common::String>::iterator i = _speechQueue.begin(); i != _speechQueue.end(); i++) {
- if (spd_say(_connection, SPD_MESSAGE, i->c_str()) == -1)
+ if (spd_say(_connection, SPD_MESSAGE, i->c_str()) == -1) {
+ if (_connection != 0)
+ spd_close(_connection);
+ init();
return true;
+ }
}
}
else