Commit c72acfe6 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't let encoding progress dialog hang infinitely if ffmpeg failed to run

parent e35c0127
......@@ -154,11 +154,15 @@ private:
QEventLoop loop;
loop.connect(&watcher, SIGNAL(sigProcessingFinished()), SLOT(quit()));
loop.connect(&ffmpegProcess, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(quit()));
loop.connect(&ffmpegProcess, SIGNAL(error(QProcess::ProcessError)), SLOT(quit()));
loop.connect(&watcher, SIGNAL(sigProgressChanged(int)), &progress, SLOT(setValue(int)));
loop.exec();
// wait for some erroneous case
ffmpegProcess.waitForFinished(5000);
if (ffmpegProcess.state() != QProcess::NotRunning) {
loop.exec();
// wait for some erroneous case
ffmpegProcess.waitForFinished(5000);
}
KisImageBuilder_Result retval = KisImageBuilder_RESULT_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment