-void RenderJob::receivedStderr() {
- QString result = QString(m_renderProcess->readAllStandardError()).simplified();
- if (!result.startsWith("Current Frame")) m_errorMessage.append(result + "<br>");
- m_logstream << "ReceivedStderr from inigo: " << result << endl;
- result = result.section(" ", -1);
- int pro = result.toInt();
- if (m_kdenliveinterface && pro > m_progress) {
- m_dbusargs[1] = pro;
- m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, "setRenderingProgress", m_dbusargs);
- }
- if (m_jobUiserver && pro > m_progress) {
- m_progress = pro;
- m_jobUiserver->call("setPercent", (uint) m_progress);
- int seconds = m_startTime.secsTo(QTime::currentTime());
- seconds = seconds * (100 - m_progress) / m_progress;
- m_jobUiserver->call("setDescriptionField", (uint) 1, tr("Remaining time"), QTime(0, 0, seconds).toString("hh:mm:ss"));
- }
+void RenderJob::receivedStderr()
+{
+ QString result = QString::fromLocal8Bit(m_renderProcess->readAllStandardError()).simplified();
+ //fprintf(stderr, "* * * *RENDER LG: %s\n", result.toUtf8().data());
+ if (!result.startsWith(QLatin1String("Current Frame"))) m_errorMessage.append(result + QLatin1String("<br>"));
+ else {
+ if (m_enablelog) m_logstream << "ReceivedStderr from melt: " << result << endl;
+ result = result.section(QLatin1Char(' '), -1);
+ int pro = result.toInt();
+ if (pro < 0 || pro > 100) return;
+ if (pro > m_progress) {
+ m_progress = pro;
+ if (m_args.contains(QLatin1String("pass=1"))) {
+ m_progress /= 2.0;
+ } else if (m_args.contains(QLatin1String("pass=2"))) {
+ m_progress = 50 + m_progress / 2.0;
+ }
+ if (m_kdenliveinterface) {
+ if (!m_kdenliveinterface->isValid()) {
+ delete m_kdenliveinterface;
+ m_kdenliveinterface = NULL;
+ // qDebug() << "BROKEN COMMUNICATION WITH KDENLIVE";
+ } else {
+ m_dbusargs[1] = m_progress;
+ m_kdenliveinterface->callWithArgumentList(QDBus::NoBlock, QLatin1String("setRenderingProgress"), m_dbusargs);
+ }
+ } else if (pro % 5 == 0) {
+ // Try to restart communication with Kdenlive every 5 percents
+ // qDebug() << "TRYING TO RESTART COMMUNICATION WITH KDENLIVE";
+ initKdenliveDbusInterface();
+ }