minor cleanup

parent a6bff2f9
......@@ -559,11 +559,11 @@ void TimelineItemModel::notifyChange(const QModelIndex &topleft, const QModelInd
void TimelineItemModel::buildTrackCompositing(bool rebuild)
{
auto it = m_allTracks.cbegin();
QScopedPointer<Mlt::Service> service(m_tractor->field());
QScopedPointer<Mlt::Field> field(m_tractor->field());
field->lock();
// Make sure all previous track compositing is removed
if (rebuild) {
QScopedPointer<Mlt::Service> service(m_tractor->field());
while (service != nullptr && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition)service->get_service());
......@@ -589,7 +589,7 @@ void TimelineItemModel::buildTrackCompositing(bool rebuild)
transition->set("internal_added", 237);
transition->set("always_active", 1);
transition->set_tracks(0, trackPos);
field->plant_transition(*transition, 0, trackPos);
field->plant_transition(*transition.get(), 0, trackPos);
} else if ((*it)->isAudioTrack()) {
// audio mix
std::unique_ptr<Mlt::Transition> transition = TransitionsRepository::get()->getTransition(QStringLiteral("mix"));
......@@ -597,7 +597,7 @@ void TimelineItemModel::buildTrackCompositing(bool rebuild)
transition->set("always_active", 1);
transition->set("sum", 1);
transition->set_tracks(0, trackPos);
field->plant_transition(*transition, 0, trackPos);
field->plant_transition(*transition.get(), 0, trackPos);
if (hasMixer) {
pCore->mixer()->registerTrack((*it)->getId(), (*it)->getTrackService(), getTrackTagById((*it)->getId()));
}
......
......@@ -1706,6 +1706,7 @@ void TimelineController::switchCompositing(int mode)
if (t.get_int("internal_added") == 237 && serviceName != QLatin1String("mix")) {
// remove all compositing transitions
field->disconnect_service(t);
t.disconnect_all_producers();
}
}
service.reset(service->producer());
......
......@@ -156,7 +156,7 @@ std::unique_ptr<Mlt::Transition> TransitionsRepository::getTransition(const QStr
Q_ASSERT(exists(transitionId));
QString service_name = m_assets.at(transitionId).mltId;
// We create the Mlt element from its name
auto transition = std::make_unique<Mlt::Transition>(pCore->getCurrentProfile()->profile(), service_name.toLatin1().constData(), nullptr);
auto transition = std::make_unique<Mlt::Transition>(pCore->getCurrentProfile()->profile(), service_name.toUtf8().constData());
transition->set("kdenlive_id", transitionId.toUtf8().constData());
return transition;
}
......
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