From aa3f73c811cd457af917f793e3f226c24195a7e7 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 19 Aug 2024 22:21:13 +0300 Subject: [PATCH] ffmpeg: also remove output if conversion fails --- ffmpeg/convert.go | 1 + 1 file changed, 1 insertion(+) diff --git a/ffmpeg/convert.go b/ffmpeg/convert.go index f032932..9cf0bb9 100644 --- a/ffmpeg/convert.go +++ b/ffmpeg/convert.go @@ -73,6 +73,7 @@ func ConvertPath(ctx context.Context, inputFile string, outputExtension string, cmd.Stderr = logWriter err := cmd.Run() if err != nil { + _ = os.Remove(outputFilename) return "", fmt.Errorf("ffmpeg error: %w", err) }