if (dia_ui->outPoint() != clip->duration().frames(m_activeDocument->fps()) - 1) {
// duration changed, we need to update duration
newprops.insert("out", QString::number(dia_ui->outPoint()));
+ int currentLength = QString(clip->producerProperty("length")).toInt();
+ if (currentLength <= dia_ui->outPoint())
+ newprops.insert("length", QString::number(dia_ui->outPoint() + 1));
+ else newprops.insert("length", clip->producerProperty("length"));
}
if (!path.isEmpty()) {
// we are editing an external file, asked if we want to detach from that file or save the result to that title file.
}
int clipOut = 0;
+ int duration = 0;
if (xml.hasAttribute("out")) clipOut = 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 (xml.hasAttribute("length")) {
+ if (clipOut > 0) duration = clipOut + 1;
length = xml.attribute("length").toInt();
clipOut = length - 1;
}
int frameNumber = xml.attribute("thumbnail", "0").toInt();
if (frameNumber != 0) producer->seek(frameNumber);
- filePropertyMap["duration"] = QString::number(producer->get_playtime());
- //kDebug() << "/////// PRODUCER: " << url.path() << " IS: " << producer.get_playtime();
+ filePropertyMap["duration"] = QString::number(duration > 0 ? duration : producer->get_playtime());
+ //kDebug() << "/////// PRODUCER: " << url.path() << " IS: " << producer->get_playtime();
Mlt::Frame *frame = producer->get_frame();