[FFmpeg-cvslog] textformat/tw_avio: Remove close_on_uninit param from create_file

Andreas Rheinhardt git at videolan.org
Wed Apr 16 07:25:20 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Apr 15 00:49:22 2025 +0200| [b9450583bcdd6bc4f7a7e3550a0fae97e12aa381] | committer: Andreas Rheinhardt

textformat/tw_avio: Remove close_on_uninit param from create_file

avtextwriter_create_file() creates an AVIOContext whose pointer
resides in its private context. If it were not always closed on
uninit, the AVIOContext would leak, so it makes no sense
to have this parameter.

Reviewed-by: softworkz . <softworkz-at-hotmail.com at ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 fftools/ffprobe.c                  | 2 +-
 fftools/textformat/avtextwriters.h | 2 +-
 fftools/textformat/tw_avio.c       | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index e0a7322523..0953a029a0 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3161,7 +3161,7 @@ int main(int argc, char **argv)
     }
 
     if (output_filename) {
-        ret = avtextwriter_create_file(&wctx, output_filename, 1);
+        ret = avtextwriter_create_file(&wctx, output_filename);
     } else
         ret = avtextwriter_create_stdout(&wctx);
 
diff --git a/fftools/textformat/avtextwriters.h b/fftools/textformat/avtextwriters.h
index a62f2c8906..87b0024ba1 100644
--- a/fftools/textformat/avtextwriters.h
+++ b/fftools/textformat/avtextwriters.h
@@ -61,7 +61,7 @@ int avtextwriter_create_stdout(AVTextWriterContext **pwctx);
 
 int avtextwriter_create_avio(AVTextWriterContext **pwctx, AVIOContext *avio_ctx, int close_on_uninit);
 
-int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit);
+int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename);
 
 int avtextwriter_create_buffer(AVTextWriterContext **pwctx, AVBPrint *buffer);
 
diff --git a/fftools/textformat/tw_avio.c b/fftools/textformat/tw_avio.c
index a80b0d2588..6034f74ec9 100644
--- a/fftools/textformat/tw_avio.c
+++ b/fftools/textformat/tw_avio.c
@@ -76,7 +76,7 @@ const AVTextWriter avtextwriter_avio = {
     .writer_w8            = io_w8
 };
 
-int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename, int close_on_uninit)
+int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_filename)
 {
     IOWriterContext *ctx;
     int ret;
@@ -95,7 +95,7 @@ int avtextwriter_create_file(AVTextWriterContext **pwctx, const char *output_fil
         return ret;
     }
 
-    ctx->close_on_uninit = close_on_uninit;
+    ctx->close_on_uninit = 1;
 
     return ret;
 }



More information about the ffmpeg-cvslog mailing list