Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit e6243f36 authored by Nicolas Carion's avatar Nicolas Carion

fix memory leak in cloneProducer

parent 211e25e5
......@@ -749,7 +749,8 @@ std::shared_ptr<Mlt::Producer> ProjectClip::timelineProducer(PlaylistState::Clip
std::shared_ptr<Mlt::Producer> ProjectClip::cloneProducer(Mlt::Profile *destProfile, bool removeEffects)
Mlt::Consumer c(*m_masterProducer->profile(), "xml", "string");
Mlt::Profile master_profile(mlt_profile_clone(m_masterProducer->get_profile()));
Mlt::Consumer c(master_profile, "xml", "string");
Mlt::Service s(m_masterProducer->get_service());
int ignore = s.get_int("ignore_points");
if (ignore) {
......@@ -767,7 +768,8 @@ std::shared_ptr<Mlt::Producer> ProjectClip::cloneProducer(Mlt::Profile *destProf
s.set("ignore_points", ignore);
const QByteArray clipXml = c.get("string");
std::shared_ptr<Mlt::Producer> prod(new Mlt::Producer(destProfile ? *destProfile : *m_masterProducer->profile(), "xml-string", clipXml.constData()));
std::shared_ptr<Mlt::Producer> prod;
prod.reset(new Mlt::Producer(destProfile ? *destProfile : master_profile, "xml-string", clipXml.constData()));
if (strcmp(prod->get("mlt_service"), "avformat") == 0) {
prod->set("mlt_service", "avformat-novalidate");
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