1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2012-02-22 22:31:42 +01:00
parent d8fd988cf2
commit 1a4a934d5e

View file

@ -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;