[FFmpeg-cvslog] fftools/ffmpeg: stop calling exit_program()

Anton Khirnov git at videolan.org
Thu Jul 20 21:57:54 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Jul 14 18:36:05 2023 +0200| [ccc684993276248d64c328a810fb7714af2f4c70] | committer: Anton Khirnov

fftools/ffmpeg: stop calling exit_program()

Remove exit_program() and register_exit(), as they are no longer used.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ccc684993276248d64c328a810fb7714af2f4c70
---

 fftools/cmdutils.c | 15 ---------------
 fftools/cmdutils.h | 10 ----------
 fftools/ffmpeg.c   |  4 +---
 3 files changed, 1 insertion(+), 28 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index ed507a8f2e..156c13801a 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -83,21 +83,6 @@ void init_dynload(void)
 #endif
 }
 
-static void (*program_exit)(int ret);
-
-void register_exit(void (*cb)(int ret))
-{
-    program_exit = cb;
-}
-
-void exit_program(int ret)
-{
-    if (program_exit)
-        program_exit(ret);
-
-    exit(ret);
-}
-
 int parse_number(const char *context, const char *numstr, int type,
                  double min, double max, double *dst)
 {
diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
index 6d4708f32e..8b67d827cc 100644
--- a/fftools/cmdutils.h
+++ b/fftools/cmdutils.h
@@ -49,16 +49,6 @@ extern AVDictionary *swr_opts;
 extern AVDictionary *format_opts, *codec_opts;
 extern int hide_banner;
 
-/**
- * Register a program-specific cleanup routine.
- */
-void register_exit(void (*cb)(int ret));
-
-/**
- * Wraps exit with a program-specific cleanup routine.
- */
-void exit_program(int ret) av_noreturn;
-
 /**
  * Initialize dynamic library loading
  */
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index ecb3f89f85..6130fd06fc 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1324,8 +1324,6 @@ int main(int argc, char **argv)
 
     init_dynload();
 
-    register_exit(ffmpeg_cleanup);
-
     setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
 
     av_log_set_flags(AV_LOG_SKIP_REPEATED);
@@ -1376,6 +1374,6 @@ finish:
     if (ret == AVERROR_EXIT)
         ret = 0;
 
-    exit_program(ret);
+    ffmpeg_cleanup(ret);
     return ret;
 }



More information about the ffmpeg-cvslog mailing list