Commit 02d09e04 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Merge branch 'release/20.12' of invent.kde.org:multimedia/kdenlive into 2012

parents b9aa046d 0b60b1e9
......@@ -752,6 +752,7 @@ std::shared_ptr<Mlt::Producer> ProjectClip::getTimelineProducer(int trackId, int
Mlt::Properties cloneProps(warpProducer->get_properties());
cloneProps.pass_list(original, ClipController::getPassPropertiesList(false));
warpProducer->set("length", (int) (original_length / std::abs(speed) + 0.5));
warpProducer->set("audio_index", audioStream);
}
qDebug() << "warp LENGTH" << warpProducer->get_length();
......
......@@ -1299,12 +1299,14 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte
QDomNodeList producers = doc.elementsByTagName(QStringLiteral("producer"));
QString producerResource;
QString producerService;
QString originalProducerService;
QString suffix;
QString prefix;
for (int n = 0; n < producers.length(); ++n) {
QDomElement e = producers.item(n).toElement();
producerResource = Xml::getXmlProperty(e, QStringLiteral("resource"));
producerService = Xml::getXmlProperty(e, QStringLiteral("mlt_service"));
originalProducerService = Xml::getXmlProperty(e, QStringLiteral("kdenlive:original.mlt_service"));
if (producerResource.isEmpty() || producerService == QLatin1String("color")) {
continue;
}
......@@ -1327,6 +1329,10 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte
producerResource.prepend(root);
}
if (proxies.contains(producerResource)) {
if (!originalProducerService.isEmpty() && originalProducerService!= producerService) {
// Proxy clips can sometimes use a different mlt service, for example playlists (xml) will use avformat. Fix
Xml::setXmlProperty(e, QStringLiteral("mlt_service"), originalProducerService);
}
QString replacementResource = proxies.value(producerResource);
Xml::setXmlProperty(e, QStringLiteral("resource"), prefix + replacementResource + suffix);
if (producerService == QLatin1String("timewarp")) {
......
......@@ -272,6 +272,11 @@ bool LoadJob::startJob()
if (type == ClipType::Unknown) {
type = getTypeForService(service, m_resource);
}
if (type == ClipType::Playlist && Xml::getXmlProperty(m_xml, QStringLiteral("kdenlive:proxy")).length() > 2) {
// If this is a proxied playlist, load as AV
type = ClipType::AV;
service.clear();
}
switch (type) {
case ClipType::Color:
m_producer = loadResource(m_resource, QStringLiteral("color:"));
......
......@@ -141,6 +141,10 @@ bool ProxyJob::startJob()
continue;
} else {
t.replace(QLatin1Char(' '), QLatin1String("="));
if (t == QLatin1String("acodec=copy") && type == ClipType::Playlist) {
// drop this for playlists, otherwise we have no sound in proxies
continue;
}
}
mltParameters << t;
}
......
......@@ -663,6 +663,10 @@ void ClipController::checkAudioVideo()
if (orig_service.startsWith(QStringLiteral("avformat")) || (m_masterProducer->get_int("audio_index") + m_masterProducer->get_int("video_index") > 0)) {
m_hasAudio = m_masterProducer->get_int("audio_index") >= 0;
m_hasVideo = m_masterProducer->get_int("video_index") >= 0;
} else if (orig_service == QStringLiteral("xml")) {
// Playlist, assume we have audio and video
m_hasAudio = true;
m_hasVideo = true;
} else {
// Assume image or text producer
m_hasAudio = false;
......
......@@ -425,11 +425,13 @@ ClipPropertiesController::ClipPropertiesController(ClipController *controller, Q
connect(box, &QAbstractButton::toggled, spin1, &QWidget::setEnabled);
connect(box, &QAbstractButton::toggled, spin2, &QWidget::setEnabled);
vbox->addLayout(hlay);
}
if (m_type == ClipType::AV || m_type == ClipType::Video || m_type == ClipType::Image || m_type == ClipType::Playlist) {
// Proxy
QString proxy = m_properties->get("kdenlive:proxy");
m_originalProperties.insert(QStringLiteral("kdenlive:proxy"), proxy);
hlay = new QHBoxLayout;
QHBoxLayout *hlay = new QHBoxLayout;
auto *bg = new QGroupBox(this);
bg->setCheckable(false);
bg->setFlat(true);
......@@ -1046,6 +1048,7 @@ void ClipPropertiesController::slotReloadProperties()
break;
case ClipType::Image:
case ClipType::AV:
case ClipType::Playlist:
case ClipType::Video: {
QString proxy = m_properties->get("kdenlive:proxy");
if (proxy != m_originalProperties.value(QStringLiteral("kdenlive:proxy"))) {
......
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