Fix crash on some projects opening

BUG: 409477
parent f049619c
Pipeline #34697 failed with stage
in 17 minutes and 26 seconds
...@@ -69,8 +69,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin ...@@ -69,8 +69,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
} }
pCore->bin()->loadFolderState(foldersToExpand); pCore->bin()->loadFolderState(foldersToExpand);
QSet<QString> reserved_names{QLatin1String("playlistmain"), QLatin1String("timeline_preview"), QLatin1String("timeline_overlay"), QSet<QString> reserved_names{QLatin1String("playlistmain"), QLatin1String("timeline_preview"), QLatin1String("timeline_overlay"), QLatin1String("black_track"), QLatin1String("overlay_track")};
QLatin1String("black_track")};
bool ok = true; bool ok = true;
qDebug() << "//////////////////////\nTrying to construct" << tractor.count() << "tracks.\n////////////////////////////////"; qDebug() << "//////////////////////\nTrying to construct" << tractor.count() << "tracks.\n////////////////////////////////";
...@@ -148,12 +147,17 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin ...@@ -148,12 +147,17 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
while ((service != nullptr) && service->is_valid()) { while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) { if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service()); Mlt::Transition t((mlt_transition)service->get_service());
if (t.get_b_track() >= timeline->tractor()->count()) {
// Composition outside of available track, maybe because of a preview track
service.reset(service->producer());
continue;
}
QString id(t.get("kdenlive_id")); QString id(t.get("kdenlive_id"));
QString internal(t.get("internal_added")); QString internal(t.get("internal_added"));
if (internal.isEmpty()) { if (internal.isEmpty()) {
compositions << new Mlt::Transition(t); compositions << new Mlt::Transition(t);
if (id.isEmpty()) { if (id.isEmpty()) {
qDebug() << "// Warning, this should not happen, transition without id: " << t.get("id") << " = " << t.get("mlt_service"); qDebug() << "// Warning, this should not happen, transition without id: " << t.get("id") << " = " << t.get("mlt_service")<<", ON TRACK: "<<t.get_b_track()<<", INVALIDS: "<<invalidTracks;
t.set("kdenlive_id", t.get("mlt_service")); t.set("kdenlive_id", t.get("mlt_service"));
} }
} }
......
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