- if (info.xml.hasAttribute("force_aspect_num") && info.xml.hasAttribute("force_aspect_den")) {
- int width = info.xml.attribute("frame_size").section('x', 0, 0).toInt();
- int height = info.xml.attribute("frame_size").section('x', 1, 1).toInt();
- int aspectNumerator = info.xml.attribute("force_aspect_num").toInt();
- int aspectDenominator = info.xml.attribute("force_aspect_den").toInt();
- if (aspectDenominator != 0 && width != 0)
- producer->set("force_aspect_ratio", double(height) * aspectNumerator / aspectDenominator / width);
- }
-
- if (info.xml.hasAttribute("force_fps")) {
- double fps = info.xml.attribute("force_fps").toDouble();
- if (fps > 0) producer->set("force_fps", fps);
- }
-
- if (info.xml.hasAttribute("force_progressive")) {
- bool ok;
- int progressive = info.xml.attribute("force_progressive").toInt(&ok);
- if (ok) producer->set("force_progressive", progressive);
- }
- if (info.xml.hasAttribute("force_tff")) {
- bool ok;
- int fieldOrder = info.xml.attribute("force_tff").toInt(&ok);
- if (ok) producer->set("force_tff", fieldOrder);
- }
- if (info.xml.hasAttribute("threads")) {
- int threads = info.xml.attribute("threads").toInt();
- if (threads != 1) producer->set("threads", threads);
- }
- if (info.xml.hasAttribute("video_index")) {
- int vindex = info.xml.attribute("video_index").toInt();
- if (vindex != 0) producer->set("video_index", vindex);
- }
- if (info.xml.hasAttribute("audio_index")) {
- int aindex = info.xml.attribute("audio_index").toInt();
- if (aindex != 0) producer->set("audio_index", aindex);
- }
- if (info.xml.hasAttribute("force_colorspace")) {
- int colorspace = info.xml.attribute("force_colorspace").toInt();
- if (colorspace != 0) producer->set("force_colorspace", colorspace);
- }
- if (info.xml.hasAttribute("full_luma")) {
- int full_luma = info.xml.attribute("full_luma").toInt();
- if (full_luma != 0) producer->set("set.force_full_luma", full_luma);
- }
-
- int clipOut = 0;
- int duration = 0;
- if (info.xml.hasAttribute("out")) clipOut = info.xml.attribute("out").toInt();
-
- // setup length here as otherwise default length (currently 15000 frames in MLT) will be taken even if outpoint is larger
- if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW) {
- int length;
- if (info.xml.hasAttribute("length")) {
- if (clipOut > 0) duration = clipOut + 1;
- length = info.xml.attribute("length").toInt();
- clipOut = length - 1;
+ if (proxyProducer && info.xml.hasAttribute("proxy_out")) {
+ producer->set("length", info.xml.attribute("proxy_out").toInt() + 1);
+ producer->set("out", info.xml.attribute("proxy_out").toInt());
+ if (producer->get_out() != info.xml.attribute("proxy_out").toInt()) {
+ // Proxy file length is different than original clip length, this will corrupt project so disable this proxy clip
+ emit removeInvalidProxy(info.clipId, true);
+ delete producer;
+ continue;
+ }