[FFmpeg-devel] [PATCH 07/29] fftools/ffmpeg: drop a useless goto

Anton Khirnov anton at khirnov.net
Sun Apr 9 17:08:31 EEST 2023


There is no cleanup in transcode(), can return an error directly.
---
 fftools/ffmpeg.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 1f50b82794..1cd9a8f29f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2905,7 +2905,7 @@ static int transcode(void)
 
     ret = transcode_init();
     if (ret < 0)
-        goto fail;
+        return ret;
 
     if (stdin_interaction) {
         av_log(NULL, AV_LOG_INFO, "Press [q] to stop, [?] for help\n");
@@ -2975,11 +2975,7 @@ static int transcode(void)
 
     hw_device_free_all();
 
-    /* finished ! */
-    ret = 0;
-
- fail:
-    return ret;
+    return 0;
 }
 
 static BenchmarkTimeStamps get_benchmark_time_stamps(void)
-- 
2.39.1



More information about the ffmpeg-devel mailing list