From 148aac33a21f8c42b64bb438425771de44eaffbd Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Mon, 29 Jun 2009 23:11:56 +0000 Subject: [PATCH] Replace acodec=vorbis with acodec=libvorbis if required for rendering: http://kdenlive.org/mantis/view.php?id=975 svn path=/trunk/kdenlive/; revision=3696 --- src/renderwidget.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index 0ed97513..35a2e017 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -931,7 +931,6 @@ void RenderWidget::refreshView() if (!sizeItem->isHidden()) { // Make sure the selected profile uses an installed avformat codec / format std = sizeItem->data(ParamsRole).toString(); - if (!formatsList.isEmpty()) { QString format; if (std.startsWith("f=")) format = std.section("f=", 1, 1); @@ -1122,6 +1121,11 @@ void RenderWidget::parseFile(QString exportFile, bool editable) QListWidgetItem *item; QDomNodeList groups = doc.elementsByTagName("group"); + const QStringList acodecsList = KdenliveSettings::audiocodecs(); + bool replaceVorbisCodec = false; + if (!acodecsList.contains("vorbis") && acodecsList.contains("libvorbis")) replaceVorbisCodec = true; + + if (editable || groups.count() == 0) { QDomElement profiles = doc.documentElement(); if (editable && profiles.attribute("version", 0).toInt() < 1) { @@ -1168,6 +1172,13 @@ void RenderWidget::parseFile(QString exportFile, bool editable) QString profileName = profile.attribute("name"); QString standard = profile.attribute("standard"); QString params = profile.attribute("args"); + + if (replaceVorbisCodec && params.contains("acodec=vorbis")) { + // replace vorbis with libvorbis + params = params.replace("vorbis", "libvorbis"); + } + + QString category = profile.attribute("category", i18n("Custom")); QString dest = profile.attribute("destinationid"); QString prof_extension = profile.attribute("extension"); @@ -1274,6 +1285,11 @@ void RenderWidget::parseFile(QString exportFile, bool editable) profileName = profileElement.attribute("name"); standard = profileElement.attribute("standard"); params = profileElement.attribute("args"); + + if (replaceVorbisCodec && params.contains("acodec=vorbis")) { + // replace vorbis with libvorbis + params = params.replace("vorbis", "libvorbis"); + } prof_extension = profileElement.attribute("extension"); if (!prof_extension.isEmpty()) extension = prof_extension; item = new QListWidgetItem(profileName, m_view.size_list); -- 2.39.2