Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure length is in time format (not frame) #1125

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/mltcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ Producer* Controller::setupNewProducer(Producer* newProducer) const
{
// Call this function before adding a new producer to Shotcut so that
// It will be configured correctly. The returned producer must be deleted.
Producer* ret = nullptr;
QString serviceName = newProducer->get("mlt_service");
if (serviceName == "avformat")
{
Expand All @@ -911,7 +912,7 @@ Producer* Controller::setupNewProducer(Producer* newProducer) const
}
setImageDurationFromDefault(newProducer);
lockCreationTime(newProducer);
newProducer->get_length_time(mlt_time_clock);
QString length = newProducer->get_length_time(mlt_time_clock);

if (serviceName.startsWith("avformat"))
{
Expand All @@ -934,10 +935,14 @@ Producer* Controller::setupNewProducer(Producer* newProducer) const
}
filter.reset(newProducer->filter(i));
}
return chain;
ret = chain;
ddennedy marked this conversation as resolved.
Show resolved Hide resolved
}
}
return new Mlt::Producer(newProducer);
if (ret) {
ret = new Mlt::Producer(newProducer);
}
ret->set("length", qUtf8Printable(length));
ddennedy marked this conversation as resolved.
Show resolved Hide resolved
return ret;
}

QUuid Controller::uuid(Mlt::Properties &properties) const
Expand Down