Skip to content

Commit

Permalink
feat: clean-up failed FFmpeg conversion files
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Feb 3, 2024
1 parent bad1f28 commit dc1595a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/src/ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ QString FFmpeg::remux(const QString &file, const QString &extension, bool delete
// Execute the conversion command
const QStringList params = { "-n", "-loglevel", "error", "-i", file, "-c", "copy", destination };
if (!execute(params, msecs)) {
// Clean-up failed conversions
if (QFile::exists(destination)) {
log(QStringLiteral("Cleaning up failed conversion target file: `%1`").arg(destination), Logger::Warning);
QFile::remove(destination);
}

return file;
}

Expand Down

0 comments on commit dc1595a

Please # to comment.