[FFmpeg-devel] [PATCH 17/18] fftools/ffmpeg_mux: rename of_close() to of_free()

Anton Khirnov anton at khirnov.net
Sat Aug 26 18:11:43 EEST 2023


This function is primarily a destructor for OutputFile, the underlying
AVIOContext is normally closed earlier (right after writing the
trailer).
---
 fftools/ffmpeg.c     | 3 +--
 fftools/ffmpeg.h     | 2 +-
 fftools/ffmpeg_mux.c | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8b0f31aac6..45844b489f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -362,9 +362,8 @@ static void ffmpeg_cleanup(int ret)
         fg_free(&filtergraphs[i]);
     av_freep(&filtergraphs);
 
-    /* close files */
     for (i = 0; i < nb_output_files; i++)
-        of_close(&output_files[i]);
+        of_free(&output_files[i]);
 
     for (i = 0; i < nb_input_files; i++)
         ifile_close(&input_files[i]);
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index ef5bb13908..9c85df5bdf 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -821,7 +821,7 @@ int enc_flush(void);
 int of_stream_init(OutputFile *of, OutputStream *ost);
 int of_write_trailer(OutputFile *of);
 int of_open(const OptionsContext *o, const char *filename);
-void of_close(OutputFile **pof);
+void of_free(OutputFile **pof);
 
 void of_enc_stats_close(void);
 
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 076c6afabd..3d6309c3c0 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -908,7 +908,7 @@ static void fc_close(AVFormatContext **pfc)
     *pfc = NULL;
 }
 
-void of_close(OutputFile **pof)
+void of_free(OutputFile **pof)
 {
     OutputFile *of = *pof;
     Muxer *mux;
-- 
2.40.1



More information about the ffmpeg-devel mailing list