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

Fix possible crash in transcoding dialog if there are no clips to convert

parent 81316715
Pipeline #177696 passed with stage
in 9 minutes and 18 seconds
......@@ -4961,6 +4961,7 @@ void Bin::requestTranscoding(const QString &url, const QString &id, int type, bo
m_transcodingDialog = new TranscodeSeek(this);
connect(m_transcodingDialog, &QDialog::accepted, this, [&, checkProfile] () {
QMap<QString,QStringList> ids = m_transcodingDialog->ids();
if (!ids.isEmpty()) {
QString firstId = ids.firstKey();
QMapIterator<QString, QStringList> i(ids);
while (i.hasNext()) {
......@@ -4968,14 +4969,19 @@ void Bin::requestTranscoding(const QString &url, const QString &id, int type, bo
std::shared_ptr<ProjectClip> clip = m_itemModel->getClipByBinID(i.key());
TranscodeTask::start({ObjectType::BinClip,i.key().toInt()}, i.value().first(), m_transcodingDialog->preParams(), m_transcodingDialog->params(i.value().at(1).toInt()), -1, -1, true, clip.get(), false, i.key() == firstId ? checkProfile : false);
}
}
m_transcodingDialog->deleteLater();
m_transcodingDialog = nullptr;
});
connect(m_transcodingDialog, &QDialog::rejected, this, [&, checkProfile] () {
QString firstId = m_transcodingDialog->ids().firstKey();
QMap<QString,QStringList> ids = m_transcodingDialog->ids();
QString firstId;
if (!ids.isEmpty()) {
firstId = ids.firstKey();
}
m_transcodingDialog->deleteLater();
m_transcodingDialog = nullptr;
if (checkProfile) {
if (checkProfile && !firstId.isEmpty()) {
pCore->bin()->slotCheckProfile(firstId);
}
});
......
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