Commit 424ab7bb authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Project loading: detect and fix corruption if audio or video clips on the same...

Project loading: detect and fix corruption if audio or video clips on the same track use a different producer
parent de4c5c51
Pipeline #181335 passed with stage
in 5 minutes and 56 seconds
......@@ -991,6 +991,12 @@ std::pair<std::shared_ptr<Mlt::Producer>, bool> ProjectClip::giveMasterAndGetTim
if (secondPlaylist) {
tid = -tid;
}
if (m_audioProducers.find(tid) != m_audioProducers.end()) {
// Buggy project, all clips in a track should use the same track producer, fix
qDebug()<<"/// FOUND INCORRECT PRODUCER ON AUDIO TRACK; FIXING";
std::shared_ptr<Mlt::Producer> prod(getTimelineProducer(tid, clipId, state, master->parent().get_int("audio_index"), speed)->cut(in, out));
return {prod, false};
}
m_audioProducers[tid] = std::make_shared<Mlt::Producer>(&master->parent());
m_effectStack->loadService(m_audioProducers[tid]);
return {master, true};
......@@ -1002,6 +1008,12 @@ std::pair<std::shared_ptr<Mlt::Producer>, bool> ProjectClip::giveMasterAndGetTim
if (secondPlaylist) {
tid = -tid;
}
if (m_videoProducers.find(tid) != m_videoProducers.end()) {
qDebug()<<"/// FOUND INCORRECT PRODUCER ON VIDEO TRACK; FIXING";
// Buggy project, all clips in a track should use the same track producer, fix
std::shared_ptr<Mlt::Producer> prod(getTimelineProducer(tid, clipId, state, master->parent().get_int("audio_index"), speed)->cut(in, out));
return {prod, false};
}
m_videoProducers[tid] = std::make_shared<Mlt::Producer>(&master->parent());
m_effectStack->loadService(m_videoProducers[tid]);
} else {
......
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