- QString render = args.at(0);
- args.takeFirst();
- QString rendermodule = args.at(0);
- args.takeFirst();
- QString player = args.at(0);
- args.takeFirst();
- QString src = args.at(0);
- args.takeFirst();
- QString dest = args.at(0);
- args.takeFirst();
- RenderJob *job = new RenderJob(erase, render, rendermodule, player, src, dest, args, in, out);
+ QStringList vprelist = vpre.replace("vpre=", "").split(',');
+ if (vprelist.size() > 0) {
+ args.replaceInStrings(QRegExp("^vpre=.*"), QString("vpre=").append(vprelist.at(0)));
+ }
+
+ if (args.contains("pass=2")) {
+ // dual pass encoding
+ dualpass = true;
+ doerase = false;
+ args.replace(args.indexOf("pass=2"), "pass=1");
+ if (args.contains("vcodec=libx264")) args << QString("passlogfile=%1").arg(dest + ".log");
+ } else {
+ args.removeAll("pass=1");
+ doerase = erase;
+ }
+
+ // Decode metadata
+ for (int i = 0; i < args.count(); ++i) {
+ if (args.at(i).startsWith("meta.attr")) {
+ QString data = args.at(i);
+ args.replace(i, data.section('=', 0, 0) + "=\"" + QUrl::fromPercentEncoding(data.section('=', 1).toUtf8()) + "\"");
+ }
+ }
+
+ qDebug() << "//STARTING RENDERING: " << erase << "," << usekuiserver << "," << render << "," << profile << "," << rendermodule << "," << player << "," << src << "," << dest << "," << preargs << "," << args << "," << in << "," << out ;
+ RenderJob *job = new RenderJob(doerase, usekuiserver, pid, render, profile, rendermodule, player, src, dest, preargs, args, in, out);
+ if (!locale.isEmpty()) job->setLocale(locale);