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

Add AppImage specific code to ensure we always set the correct path for MLT, FFmpeg, etc

parent 5600246b
Pipeline #3444 passed with stage
in 14 minutes and 13 seconds
......@@ -68,7 +68,7 @@ Core::~Core()
ClipController::mediaUnavailable.reset();
}
void Core::build(const QString &MltPath)
void Core::build(bool isAppImage, const QString &MltPath)
{
if (m_self) {
return;
......@@ -86,9 +86,18 @@ void Core::build(const QString &MltPath)
qRegisterMetaType<QVector<int>>();
qRegisterMetaType<QDomElement>("QDomElement");
qRegisterMetaType<requestClipInfo>("requestClipInfo");
// Open connection with Mlt
MltConnection::construct(MltPath);
if (isAppImage) {
QString appPath = qApp->applicationDirPath();
KdenliveSettings::setFfmpegpath(QDir::cleanPath(appPath + QStringLiteral("/ffmpeg")));
KdenliveSettings::setFfplaypath(QDir::cleanPath(appPath + QStringLiteral("/ffplay")));
KdenliveSettings::setFfprobepath(QDir::cleanPath(appPath + QStringLiteral("/ffprobe")));
KdenliveSettings::setRendererpath(QDir::cleanPath(appPath + QStringLiteral("/melt")));
MltConnection::construct(QDir::cleanPath(appPath + QStringLiteral("/../share/mlt/profiles")));
} else {
// Open connection with Mlt
MltConnection::construct(MltPath);
}
// load the profile from disk
ProfileRepository::get()->refresh();
......
......@@ -65,9 +65,11 @@ public:
/**
* @brief Setup the basics of the application, in particular the connection
* with Mlt
* @param isAppImage do we expect an AppImage (if yes, we use App path to deduce
* other binaries paths (melt, ffmpeg, etc)
* @param MltPath (optional) path to MLT environment
*/
static void build(const QString &MltPath = QString());
static void build(bool isAppImage, const QString &MltPath = QString());
/**
* @brief Init the GUI part of the app and show the main window
......
......@@ -182,7 +182,6 @@ int main(int argc, char *argv[])
1, 0, // major and minor version of the import
"ProducerType", // name in QML
"Error: only enums");
QString mltPath = parser.value(QStringLiteral("mlt-path"));
if (parser.value(QStringLiteral("mlt-log")) == QStringLiteral("verbose")) {
mlt_log_set_level(MLT_LOG_VERBOSE);
} else if (parser.value(QStringLiteral("mlt-log")) == QStringLiteral("debug")) {
......@@ -196,8 +195,7 @@ int main(int argc, char *argv[])
QUrl startup = QUrl::fromLocalFile(currentPath.endsWith(QDir::separator()) ? currentPath : currentPath + QDir::separator());
url = startup.resolved(url);
}
//qApp->processEvents();
Core::build(mltPath);
Core::build(!parser.value(QStringLiteral("config")).isEmpty(), parser.value(QStringLiteral("mlt-path")));
pCore->initGUI(url);
//delete splash;
//splash->endSplash();
......
......@@ -19,7 +19,7 @@ int main(int argc, char *argv[])
app.setApplicationName(QStringLiteral("kdenlive"));
std::unique_ptr<Mlt::Repository> repo(Mlt::Factory::init(nullptr));
qputenv("MLT_TESTS", QByteArray("1"));
Core::build();
Core::build(false);
Logger::init();
// if Kdenlive is not installed, ensure we have one keyframable effect
EffectsRepository::get()->reloadCustom(QFileInfo("../data/effects/audiobalance.xml").absoluteFilePath());
......
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