Fix crash on movit clip jobs.

Fixes #542
parent 9fbafcdc
Pipeline #13977 passed with stage
in 18 minutes and 15 seconds
......@@ -861,6 +861,18 @@ std::shared_ptr<Mlt::Producer> ProjectClip::softClone(const char *list)
return clone;
}
std::unique_ptr<Mlt::Producer> ProjectClip::getClone()
{
const char *list = ClipController::getPassPropertiesList();
QString service = QString::fromLatin1(m_masterProducer->get("mlt_service"));
QString resource = QString::fromUtf8(m_masterProducer->get("resource"));
std::unique_ptr<Mlt::Producer> clone(new Mlt::Producer(*m_masterProducer->profile(), service.toUtf8().constData(), resource.toUtf8().constData()));
Mlt::Properties original(m_masterProducer->get_properties());
Mlt::Properties cloneProps(clone->get_properties());
cloneProps.pass_list(original, list);
return clone;
}
bool ProjectClip::isReady() const
{
return m_clipStatus == StatusReady;
......
......@@ -215,6 +215,9 @@ public:
std::shared_ptr<Mlt::Producer> cloneProducer(bool removeEffects = false);
static std::shared_ptr<Mlt::Producer> cloneProducer(const std::shared_ptr<Mlt::Producer> &producer);
std::shared_ptr<Mlt::Producer> softClone(const char *list);
/** @brief Returns a clone of the producer, useful for movit clip jobs
*/
std::unique_ptr<Mlt::Producer> getClone();
void updateTimelineClips(const QVector<int> &roles);
/** @brief Saves the subclips data as json
*/
......
......@@ -104,9 +104,13 @@ bool MeltJob::startJob()
double fps = projectProfile->fps();
int fps_num = projectProfile->frame_rate_num();
int fps_den = projectProfile->frame_rate_den();
m_producer = std::make_unique<Mlt::Producer>(*m_profile.get(), m_url.toUtf8().constData());
if (KdenliveSettings::gpu_accel()) {
m_producer = binClip->getClone();
Mlt::Filter converter(*m_profile.get(), "avcolor_space");
m_producer->attach(converter);
} else {
m_producer = std::make_unique<Mlt::Producer>(*m_profile.get(), m_url.toUtf8().constData());
}
if (m_producer && m_useProducerProfile) {
m_profile->from_producer(*m_producer.get());
m_profile->set_explicit(1);
......
......@@ -63,7 +63,6 @@ void SceneSplitJob::configureConsumer()
void SceneSplitJob::configureFilter()
{
m_filter = std::make_unique<Mlt::Filter>(*m_profile.get(), "motion_est");
if ((m_filter == nullptr) || !m_filter->is_valid()) {
m_errorMessage.append(i18n("Cannot create filter motion_est. Cannot split scenes"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment