Skip to content

Commit d6bd196

Browse files
committed
fix(Composition Renderer): Fix crash on missing audio file.
This occurred if the user opend the composition, then renamed/deleted it and then tried to render a video.
1 parent 085fb59 commit d6bd196

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/RenderingSettingsDialog.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,18 @@ void RenderingSettingsDialog::onButtonBoxAccepted() {
268268
progressDialog->setLabelText(QStringLiteral("Rendering..."));
269269
progressDialog->setValue(0); // Causes the dialog to open because of setMinimumDuration(0)
270270

271-
// Start render - no need to catch anything because we confirmed the validity above
272-
this->renderer->render(this->audioPath, this->config, filePath, resolution, backgroundColor, ffmpegPath);
271+
try {
272+
// Start render - no need to catch anything (except for missing audio file) because we confirmed the validity above
273+
this->renderer->render(this->audioPath, this->config, filePath, resolution, backgroundColor, ffmpegPath);
274+
} catch (const SourceFileException& e) {
275+
QMessageBox* msg{new QMessageBox{QMessageBox::Icon::Warning, QStringLiteral("Starting Render Failed"), QStringLiteral("Starting the renderer failed for the following reason:\n%1\n\nTry reopening the composition and try again.").arg(e.what()), QMessageBox::StandardButton::Ok, this}};
276+
connect(msg, &QDialog::finished, msg, &QObject::deleteLater); // Delete the dialog after it is closed
277+
msg->open();
278+
279+
this->progressDialog->reset();
280+
this->buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(true);
281+
return;
282+
}
273283
}
274284

275285
void RenderingSettingsDialog::onRendererAborted() {

0 commit comments

Comments
 (0)