Skip to content

Commit

Permalink
ffmpeg: also remove output if conversion fails
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Aug 19, 2024
1 parent 7396ccc commit aa3f73c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ffmpeg/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit aa3f73c

Please sign in to comment.