Fix transitions left after track deletion

CCBUG: 355380
parent ee9a1c8a
......@@ -3285,6 +3285,9 @@ void CustomTrackView::removeTrack(int ix)
}
}
}
//Manually remove all transitions issued from track ix, otherwise MLT will relocate it to another track
m_timeline->transitionHandler->deleteTrackTransitions(ix);
// Delete track in MLT playlist
tractor->remove_track(ix);
......
......@@ -285,6 +285,23 @@ void TransitionHandler::deleteTransition(QString tag, int /*a_track*/, int b_tra
//if (m_isBlocked == 0) m_mltConsumer->set("refresh", 1);
}
void TransitionHandler::deleteTrackTransitions(int ix)
{
QScopedPointer<Mlt::Field> field(m_tractor->field());
mlt_service nextservice = mlt_service_get_producer(field->get_service());
mlt_service_type type = mlt_service_identify( nextservice );
while (type == transition_type) {
Mlt::Transition transition((mlt_transition) nextservice);
nextservice = mlt_service_producer(nextservice);
int currentTrack = transition.get_b_track();
if (ix == currentTrack) {
field->disconnect_service(transition);
}
if (nextservice == NULL) break;
type = mlt_service_identify(nextservice );
}
}
bool TransitionHandler::moveTransition(QString type, int startTrack, int newTrack, int newTransitionTrack, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut)
{
int new_in = (int)newIn.frames(m_fps);
......
......@@ -44,6 +44,7 @@ public:
void updateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool force = false);
void updateTransitionParams(QString type, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
void deleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool refresh = true);
void deleteTrackTransitions(int ix);
bool moveTransition(QString type, int startTrack, int newTrack, int newTransitionTrack, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut);
QList <TransitionInfo> mltInsertTrack(int ix, const QString &name, bool videoTrack);
void duplicateTransitionOnPlaylist(int in, int out, QString tag, QDomElement xml, int a_track, int b_track, Mlt::Field *field);
......
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