Commit 82df289b authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Remove broken "duplicate bin clip with timeremap" stuff that caused crash...

Remove broken "duplicate bin clip with timeremap" stuff that caused crash dropping playlists in timeline
BUG: 441777
FIXED-IN:
parent 552d0a70
......@@ -4573,40 +4573,3 @@ bool Bin::addProjectClipInFolder(const QString &path, const QString &parentFolde
return ok;
}
void Bin::remapCurrent()
{
std::shared_ptr<ProjectClip> clip = getFirstSelectedClip();
if (clip) {
QFileInfo info(clip->url());
QDir dir =info.absoluteDir();
QString fName = info.fileName().section(QLatin1Char('.'),0, -2);
fName.append("-remap");
int ix = 1;
QString renderName = QString("%1%2.mlt").arg(fName).arg(QString::number(ix).rightJustified(4, '0'));
while (dir.exists(renderName)) {
ix++;
renderName = QString("%1%2.mlt").arg(fName).arg(QString::number(ix).rightJustified(4, '0'));
}
Mlt::Consumer consumer(pCore->getCurrentProfile()->profile(), "xml", dir.absoluteFilePath(renderName).toUtf8().constData());
consumer.set("terminate_on_pause", 1);
consumer.set("title", "Time remap");
consumer.set("real_time", -1);
Mlt::Tractor t(pCore->getCurrentProfile()->profile());
Mlt::Chain chain(pCore->getCurrentProfile()->profile(), nullptr, clip->url().toUtf8().constData());
Mlt::Link link("timeremap");
chain.attach(link);
t.set_track(chain, 0);
consumer.connect(t);
consumer.run();
Fun undo = []() { return true; };
Fun redo = []() { return true; };
std::function<void(const QString &)> callBack = [this](const QString &binId) {
selectClipById(binId);
};
auto id = ClipCreator::createClipFromFile(dir.absoluteFilePath(renderName), getCurrentFolder(), pCore->projectItemModel(), undo, redo, callBack);
pCore->pushUndo(undo, redo, i18n("Add clip remap"));
}
}
......@@ -463,8 +463,6 @@ public slots:
void showTitleWidget(const std::shared_ptr<ProjectClip> &clip);
/** @brief Add a clip in a specially named folder */
bool addProjectClipInFolder(const QString &path, const QString &parentFolder, const QString &folderName);
/** @brief Create a playlist clip for timeremap. */
void remapCurrent();
protected:
/* This function is called whenever an item is selected to propagate signals
......
......@@ -970,19 +970,7 @@ std::pair<std::shared_ptr<Mlt::Producer>, bool> ProjectClip::giveMasterAndGetTim
std::shared_ptr<Mlt::Producer> ProjectClip::cloneProducer(bool removeEffects)
{
Mlt::Consumer c(pCore->getCurrentProfile()->profile(), "xml", "string");
Mlt::Service s;
bool playlistChain = false;
QScopedPointer<Mlt::Service> serv;
if (m_clipType == ClipType::Playlist) {
serv.reset(m_masterProducer->producer());
if (serv != nullptr) {
s = Mlt::Service(serv->get_service());
playlistChain = true;
}
}
if (!playlistChain) {
s = Mlt::Service(m_masterProducer->get_service());
}
Mlt::Service s(m_masterProducer->get_service());
int ignore = s.get_int("ignore_points");
if (ignore) {
s.set("ignore_points", 0);
......@@ -999,10 +987,8 @@ std::shared_ptr<Mlt::Producer> ProjectClip::cloneProducer(bool removeEffects)
s.set("ignore_points", ignore);
}
const QByteArray clipXml = c.get("string");
std::shared_ptr<Mlt::Producer> prod;
qDebug()<<"============= CLONED CLIP: \n\n"<<clipXml<<"\n\n======================";
prod.reset(new Mlt::Producer(pCore->getCurrentProfile()->profile(), "xml-string", clipXml.constData()));
std::shared_ptr<Mlt::Producer> prod(new Mlt::Producer(pCore->getCurrentProfile()->profile(), "xml-string", clipXml.constData()));
if (strcmp(prod->get("mlt_service"), "avformat") == 0) {
prod->set("mlt_service", "avformat-novalidate");
prod->set("mute_on_pause", 0);
......
......@@ -3577,12 +3577,6 @@ void MainWindow::buildDynamicActions()
[&]() { SpeedTask::start(this); });
}
if (true /* TODO: check if timeremap link is available */) {
QAction *action = new QAction(i18n("Duplicate clip with time remap"), m_extraFactory->actionCollection());
ts->addAction(action->text(), action);
connect(action, &QAction::triggered, pCore->bin(), &Bin::remapCurrent);
}
// TODO refac reimplement analyseclipjob
/*
QAction *action = new QAction(i18n("Analyse keyframes"), m_extraFactory->actionCollection());
......
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