+ if (m_extra.contains("producer_profile")) {
+ m_profile = new Mlt::Profile;
+ m_profile->set_explicit(false);
+ }
+ else {
+ m_profile = new Mlt::Profile(KdenliveSettings::current_profile().toUtf8().constData());
+ }
+ if (m_extra.contains("resize_profile")) {
+ m_profile->set_height(m_extra.value("resize_profile").toInt());
+ m_profile->set_width(m_profile->height() * m_profile->sar());
+ }
+ if (out == -1) {
+ m_producer = new Mlt::Producer(*m_profile, m_url.toUtf8().constData());
+ if (m_producer) m_length = m_producer->get_length();
+ }
+ else {
+ Mlt::Producer *tmp = new Mlt::Producer(*m_profile, m_url.toUtf8().constData());
+ if (tmp) m_producer = tmp->cut(in, out);
+ delete tmp;
+ if (m_producer) m_length = m_producer->get_playtime();
+ }
+ if (!m_producer || !m_producer->is_valid()) {
+ // Clip was removed or something went wrong, Notify user?
+ //m_errorMessage.append(i18n("Invalid clip"));
+ setStatus(JOBCRASHED);
+ return;
+ }
+ if (m_extra.contains("producer_profile")) {
+ m_profile->from_producer(*m_producer);
+ m_profile->set_explicit(true);
+ }
+ QStringList list = producerParams.split(' ', QString::SkipEmptyParts);
+ foreach(const QString &data, list) {
+ if (data.contains('=')) {
+ m_producer->set(data.section('=', 0, 0).toUtf8().constData(), data.section('=', 1, 1).toUtf8().constData());
+ }
+ }
+ if (consumer.contains(":")) {
+ m_consumer = new Mlt::Consumer(*m_profile, consumer.section(':', 0, 0).toUtf8().constData(), consumer.section(':', 1).toUtf8().constData());
+ }
+ else {
+ m_consumer = new Mlt::Consumer(*m_profile, consumer.toUtf8().constData());
+ }