1
0
Fork 0
forked from len0rd/rockbox

Remove multithreading support from voicefile creation.

Running TTS and encoders with multiple threads is causing problems on Windows
since introduction of the feature (FS#12106, FS#11994). The current
implementation also makes wrong assumptions (having multiple threads talk to
the SAPI script doesn't make it run faster since it's still one thread
responsible for creation).

Completely remove multithreading support for that for now -- a different
implementation is necessary.

Change-Id: Icafa223644efc370a09186ce28ac83c22902e0c0
This commit is contained in:
Dominik Riebeling 2012-01-14 16:17:13 +01:00
parent c2f0ba7ecd
commit 820dcfdfed
2 changed files with 99 additions and 189 deletions

View file

@ -48,30 +48,15 @@ public:
QString target;
bool voiced;
bool encoded;
/* We need the following members because
* 1) the QtConcurrent entry points are all static methods (and we
* need to communicate with the TalkGenerator)
* 2) we are not guaranteed to go through the list in any
* particular order, so we can't use the progress slot
* for error checking */
struct
{
EncoderBase* encoder;
TTSBase* tts;
TalkGenerator* generator;
int wavtrim;
} refs;
};
TalkGenerator(QObject* parent);
Status process(QList<TalkEntry>* list,int wavtrimth = -1);
QString correctString(QString s);
public slots:
void abort();
void encProgress(int value);
void ttsProgress(int value);
void setLang(QString name);
signals:
@ -80,22 +65,12 @@ signals:
void logProgress(int, int); //! set progress bar.
private:
QFutureWatcher<void> encFutureWatcher;
QFutureWatcher<void> ttsFutureWatcher;
void encFailEntry(const TalkEntry& entry);
void ttsFailEntry(const TalkEntry& entry, TTSStatus status, QString error);
Status voiceList(QList<TalkEntry>* list,int wavetrimth);
Status encodeList(QList<TalkEntry>* list);
static void encEntryPoint(TalkEntry& entry);
static void ttsEntryPoint(TalkEntry& entry);
TTSBase* m_tts;
EncoderBase* m_enc;
bool m_ttsWarnings;
bool m_userAborted;
QString m_lang;
struct CorrectionItems
@ -105,6 +80,10 @@ private:
QString modifier;
};
QList<struct CorrectionItems> m_corrections;
bool m_abort;
};