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

Fix rendering uses wrong locale, resulting in broken slowmotion in render and...

Fix rendering uses wrong locale, resulting in broken slowmotion in render and possibly other issues on some locales
parent 270d3022
......@@ -78,7 +78,7 @@ int main(int argc, char **argv)
// After initialising the MLT factory, set the locale back from user default to C
// to ensure numbers are always serialised with . as decimal point.
Mlt::Factory::init();
LocaleHandling::resetLocale();
LocaleHandling::resetAllLocale();
Mlt::Profile profile(profilePath.toUtf8().constData());
profile.set_explicit(1);
......@@ -138,7 +138,7 @@ int main(int argc, char **argv)
playlist.append(QStringLiteral("?multi=1"));
}
}
LocaleHandling::resetAllLocale();
auto *rJob = new RenderJob(render, playlist, target, pid, in, out, qApp);
rJob->start();
QObject::connect(rJob, &RenderJob::renderingFinished, [&, rJob]() {
......
......@@ -47,6 +47,16 @@ void LocaleHandling::resetLocale()
::qputenv(MLT_LC_NAME, "C");
}
void LocaleHandling::resetAllLocale()
{
#ifdef Q_OS_FREEBSD
setlocale(LC_ALL, "C");
#else
std::setlocale(LC_ALL, "C");
#endif
::qputenv("LC_ALL", "C");
}
QPair<QLocale, LocaleHandling::MatchType> LocaleHandling::getQLocaleForDecimalPoint(const QString &requestedLocale, const QString &decimalPoint)
{
// Parse installed locales to find one matching
......
......@@ -43,6 +43,7 @@ public:
* regardless of the user's locale; many locales use , or another character as decimal point.
*/
static void resetLocale();
static void resetAllLocale();
};
#endif // KDENLIVE_LOCALEHANDLING_H
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