[FFmpeg-cvslog] fftools/ffmpeg_mux: drop OutputFile.format

Anton Khirnov git at videolan.org
Tue Apr 9 11:54:52 EEST 2024


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu Apr  4 11:05:33 2024 +0200| [bfeb751171c87e81fa940f4152b1e72eb9b0a1c0] | committer: Anton Khirnov

fftools/ffmpeg_mux: drop OutputFile.format

It is no longer used outside of the muxing code (where we can access the
muxer directly).

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

 fftools/ffmpeg.h          |  1 -
 fftools/ffmpeg_mux.c      | 15 +++++++++------
 fftools/ffmpeg_mux_init.c |  1 -
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 1d32009f90..7135d9563c 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -611,7 +611,6 @@ typedef struct OutputFile {
 
     int index;
 
-    const AVOutputFormat *format;
     const char           *url;
 
     OutputStream **streams;
diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c
index 6a64cba72d..2b7a733501 100644
--- a/fftools/ffmpeg_mux.c
+++ b/fftools/ffmpeg_mux.c
@@ -370,10 +370,11 @@ fail:
     return ret;
 }
 
-static void thread_set_name(OutputFile *of)
+static void thread_set_name(Muxer *mux)
 {
     char name[16];
-    snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name);
+    snprintf(name, sizeof(name), "mux%d:%s",
+             mux->of.index, mux->fc->oformat->name);
     ff_thread_setname(name);
 }
 
@@ -417,7 +418,7 @@ int muxer_thread(void *arg)
     if (ret < 0)
         goto finish;
 
-    thread_set_name(of);
+    thread_set_name(mux);
 
     while (1) {
         OutputStream *ost;
@@ -515,8 +516,10 @@ int print_sdp(const char *filename)
     if (!avc)
         return AVERROR(ENOMEM);
     for (int i = 0; i < nb_output_files; i++) {
-        if (!strcmp(output_files[i]->format->name, "rtp")) {
-            avc[j] = mux_from_of(output_files[i])->fc;
+        Muxer *mux = mux_from_of(output_files[i]);
+
+        if (!strcmp(mux->fc->oformat->name, "rtp")) {
+            avc[j] = mux->fc;
             j++;
         }
     }
@@ -756,7 +759,7 @@ int of_write_trailer(OutputFile *of)
 
     mux->last_filesize = filesize(fc->pb);
 
-    if (!(of->format->flags & AVFMT_NOFILE)) {
+    if (!(fc->oformat->flags & AVFMT_NOFILE)) {
         ret = avio_closep(&fc->pb);
         if (ret < 0) {
             av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret));
diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 9aad19a85d..ffcc20a504 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -3063,7 +3063,6 @@ int of_open(const OptionsContext *o, const char *filename, Scheduler *sch)
     av_strlcat(mux->log_name, oc->oformat->name, sizeof(mux->log_name));
 
 
-    of->format = oc->oformat;
     if (recording_time != INT64_MAX)
         oc->duration = recording_time;
 



More information about the ffmpeg-cvslog mailing list