- if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW)
- producer->set("length", xml.attribute("out").toInt() - xml.attribute("in").toInt() + 1);
+ if (type == COLOR || type == TEXT || type == IMAGE || type == SLIDESHOW) {
+ int length;
+ if (xml.hasAttribute("length")) length = xml.attribute("length").toInt();
+ else length = xml.attribute("out").toInt() - xml.attribute("in").toInt();
+ producer->set("length", length);
+ }