Fix track compositing duplicated on track insert/delete

parent 5d566844
......@@ -1073,6 +1073,7 @@ void TimelineFunctions::saveTimelineSelection(const std::shared_ptr<TimelineItem
}
t.set("always_active", 1);
t.set("internal_added", 237);
t.set_tracks(isAudio ? lowerAudioTrack : lowerVideoTrack, ix);
field->plant_transition(t, isAudio ? lowerAudioTrack : lowerVideoTrack, ix);
}
ix++;
......
......@@ -567,13 +567,15 @@ void TimelineItemModel::buildTrackCompositing(bool rebuild)
while (service != nullptr && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
service.reset(service->producer());
if (t.get_int("internal_added") == 237) {
// remove all compositing transitions
field->disconnect_service(t);
t.disconnect_all_producers();
}
} else {
service.reset(service->producer());
}
service.reset(service->producer());
}
}
QString composite = TransitionsRepository::get()->getCompositingTransition();
......
......@@ -1704,14 +1704,16 @@ void TimelineController::switchCompositing(int mode)
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
service.reset(service->producer());
QString serviceName = t.get("mlt_service");
if (t.get_int("internal_added") == 237 && serviceName != QLatin1String("mix")) {
// remove all compositing transitions
field->disconnect_service(t);
t.disconnect_all_producers();
}
} else {
service.reset(service->producer());
}
service.reset(service->producer());
}
if (mode > 0) {
const QString compositeGeometry =
......
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