Commit 617c3acb authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix proxied playlists rendering blank and missing sound

Fixes #928
parent c05f9827
...@@ -1299,12 +1299,14 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte ...@@ -1299,12 +1299,14 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte
QDomNodeList producers = doc.elementsByTagName(QStringLiteral("producer")); QDomNodeList producers = doc.elementsByTagName(QStringLiteral("producer"));
QString producerResource; QString producerResource;
QString producerService; QString producerService;
QString originalProducerService;
QString suffix; QString suffix;
QString prefix; QString prefix;
for (int n = 0; n < producers.length(); ++n) { for (int n = 0; n < producers.length(); ++n) {
QDomElement e = producers.item(n).toElement(); QDomElement e = producers.item(n).toElement();
producerResource = Xml::getXmlProperty(e, QStringLiteral("resource")); producerResource = Xml::getXmlProperty(e, QStringLiteral("resource"));
producerService = Xml::getXmlProperty(e, QStringLiteral("mlt_service")); producerService = Xml::getXmlProperty(e, QStringLiteral("mlt_service"));
originalProducerService = Xml::getXmlProperty(e, QStringLiteral("kdenlive:original.mlt_service"));
if (producerResource.isEmpty() || producerService == QLatin1String("color")) { if (producerResource.isEmpty() || producerService == QLatin1String("color")) {
continue; continue;
} }
...@@ -1327,6 +1329,10 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte ...@@ -1327,6 +1329,10 @@ void RenderWidget::prepareRendering(bool delayedRendering, const QString &chapte
producerResource.prepend(root); producerResource.prepend(root);
} }
if (proxies.contains(producerResource)) { 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); QString replacementResource = proxies.value(producerResource);
Xml::setXmlProperty(e, QStringLiteral("resource"), prefix + replacementResource + suffix); Xml::setXmlProperty(e, QStringLiteral("resource"), prefix + replacementResource + suffix);
if (producerService == QLatin1String("timewarp")) { if (producerService == QLatin1String("timewarp")) {
......
...@@ -141,6 +141,10 @@ bool ProxyJob::startJob() ...@@ -141,6 +141,10 @@ bool ProxyJob::startJob()
continue; continue;
} else { } else {
t.replace(QLatin1Char(' '), QLatin1String("=")); 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; mltParameters << t;
} }
......
...@@ -663,6 +663,10 @@ void ClipController::checkAudioVideo() ...@@ -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)) { 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_hasAudio = m_masterProducer->get_int("audio_index") >= 0;
m_hasVideo = m_masterProducer->get_int("video_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 { } else {
// Assume image or text producer // Assume image or text producer
m_hasAudio = false; 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