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

Fix marker thumbnail size.

Related to #1314
parent c2262e4f
......@@ -643,7 +643,17 @@ std::shared_ptr<Mlt::Producer> ProjectClip::thumbProducer()
if (mltService == QLatin1String("avformat")) {
mltService = QStringLiteral("avformat-novalidate");
}
m_thumbsProducer.reset(new Mlt::Producer(*pCore->thumbProfile(), mltService.toUtf8().constData(), mltResource.toUtf8().constData()));
Mlt::Profile *profile = pCore->thumbProfile();
if (mltService.startsWith(QLatin1String("xml"))) {
// Xml producers can corrupt the profile, so enforce width/height again after loading
int profileWidth = profile->width();
int profileHeight= profile->height();
m_thumbsProducer.reset(new Mlt::Producer(*profile, mltService.toUtf8().constData(), mltResource.toUtf8().constData()));
profile->set_width(profileWidth);
profile->set_height(profileHeight);
} else {
m_thumbsProducer.reset(new Mlt::Producer(*profile, mltService.toUtf8().constData(), mltResource.toUtf8().constData()));
}
if (m_thumbsProducer->is_valid()) {
Mlt::Properties original(m_masterProducer->get_properties());
Mlt::Properties cloneProps(m_thumbsProducer->get_properties());
......
......@@ -237,7 +237,17 @@ void ClipLoadTask::generateThumbnail(std::shared_ptr<ProjectClip>binClip, std::s
if (mltService == QLatin1String("avformat")) {
mltService = QStringLiteral("avformat-novalidate");
}
std::unique_ptr<Mlt::Producer> thumbProd(new Mlt::Producer(*pCore->thumbProfile(), mltService.toUtf8().constData(), mltResource.toUtf8().constData()));
std::unique_ptr<Mlt::Producer> thumbProd;
Mlt::Profile *profile = pCore->thumbProfile();
if (mltService.startsWith(QLatin1String("xml"))) {
int profileWidth = profile->width();
int profileHeight= profile->height();
thumbProd.reset(new Mlt::Producer(*profile, mltService.toUtf8().constData(), mltResource.toUtf8().constData()));
profile->set_width(profileWidth);
profile->set_height(profileHeight);
} else {
thumbProd.reset(new Mlt::Producer(*profile, mltService.toUtf8().constData(),mltResource.toUtf8().constData()));
}
if (thumbProd) {
thumbProd->set("audio_index", -1);
Mlt::Properties original(producer->get_properties());
......
Supports Markdown
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