Fix proxied playlists rendering blank and missing sound

Fixes #928
parent c05f9827
......@@ -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")) {
......
......@@ -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;
......
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