diff mbox series

[FFmpeg-devel,08/29] fftools/ffmpeg: move the hw_device_free_all() call to ffmpeg_cleanup()

Message ID 20230409140853.28858-8-anton@khirnov.net
State Accepted
Commit d99846d2f22b210ce91535a44822b93d522df829
Headers show
Series [FFmpeg-devel,01/29] fftools/ffmpeg: move OutputStream.vsync_frame_number to Encoder | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov April 9, 2023, 2:08 p.m. UTC
Frees devices on failure as well as success.
---
 fftools/ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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;
 }