summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/ttssapi.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-02-22 22:31:42 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-02-22 22:34:37 +0100
commit1a4a934d5eee53d16c86014e99c2f98914b13ebf (patch)
tree852b4765877db07975cd79af3ebd42dccbe28ae9 /rbutil/rbutilqt/base/ttssapi.cpp
parentd8fd988cf2f18d900accecc5f07f12ec71c48e73 (diff)
downloadrockbox-1a4a934d5eee53d16c86014e99c2f98914b13ebf.tar.gz
rockbox-1a4a934d5eee53d16c86014e99c2f98914b13ebf.tar.bz2
rockbox-1a4a934d5eee53d16c86014e99c2f98914b13ebf.zip
Don't poll SAPI script output.
Wait for the process to signal new data available instead of polling its output. Fixes synchronisation issues with sapi_voice.vbs that were causing FS#12595. Change-Id: I86e844e837ed20f32005fdccf7ec9e8c1efbe983
Diffstat (limited to 'rbutil/rbutilqt/base/ttssapi.cpp')
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index e2587b715f..00c63550d3 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -227,11 +227,8 @@ TTSStatus TTSSapi::voice(QString text,QString wavfile, QString *errStr)
*voicestream << query;
*voicestream << "SYNC\tbla\r\n";
voicestream->flush();
- char temp[20];
-
- //we use this, because waitForReadyRead doesnt work from a different thread
- while( voicescript->readLine(temp,20) == 0)
- QCoreApplication::processEvents();
+ // do NOT poll the output with readLine(), this causes sync issues!
+ voicescript->waitForReadyRead();
if(!QFileInfo(wavfile).isFile()) {
qDebug() << "[TTSSapi] output file does not exist:" << wavfile;