From 942516c84018e89f75abe51338103b4d4ebe9dbe Mon Sep 17 00:00:00 2001 From: Lukas Prediger Date: Sat, 30 Oct 2021 13:44:45 +0300 Subject: [PATCH] Transcoder now deletes created files on error --- src/transcoder/transcoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/transcoder/transcoder.cpp b/src/transcoder/transcoder.cpp index 3b0e55d20..d51aaf25a 100644 --- a/src/transcoder/transcoder.cpp +++ b/src/transcoder/transcoder.cpp @@ -432,6 +432,11 @@ void Transcoder::JobState::ReportError(GstMessage* msg) { g_error_free(error); free(debugs); + // clean up output file if it was already created + if (QFile::exists(job_.output)) { + QFile::remove(job_.output); + } + emit parent_->LogLine( tr("Error processing %1: %2") .arg(UrlToLocalFileIfPossible(job_.input), message));