diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 1cd9a8f29f..816b6c4b08 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -551,6 +551,8 @@ static void ffmpeg_cleanup(int ret) av_freep(&vstats_filename); of_enc_stats_close(); + hw_device_free_all(); + av_freep(&filter_nbthreads); av_freep(&input_files); @@ -2973,8 +2975,6 @@ static int transcode(void) exit_program(1); } - hw_device_free_all(); - return 0; }