diff mbox series

[FFmpeg-devel,v2,20/33] avformat: remove FF_API_AVSTREAM_CLASS

Message ID 20230204104204.20721-21-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,v2,01/33] avformat/avformat: Remove AVOutputFormat.data_codec | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/configure_x86 warning Failed to apply patch

Commit Message

Anton Khirnov Feb. 4, 2023, 10:41 a.m. UTC
From: James Almer <jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg_mux_init.c   | 11 -----------
 libavformat/avformat.h      |  2 --
 libavformat/options.c       |  3 ---
 libavformat/version_major.h |  1 -
 4 files changed, 17 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index f8ccf4a3e9b..34172406394 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1983,18 +1983,7 @@  static int set_dispositions(Muxer *mux, const OptionsContext *o)
             if (!disp)
                 continue;
 
-#if LIBAVFORMAT_VERSION_MAJOR >= 60
             ret = av_opt_set(ost->st, "disposition", disp, 0);
-#else
-            {
-                const AVClass *class = av_stream_get_class();
-                const AVOption    *o = av_opt_find(&class, "disposition", NULL, 0, AV_OPT_SEARCH_FAKE_OBJ);
-
-                av_assert0(o);
-                ret = av_opt_eval_flags(&class, o, disp, &ost->st->disposition);
-            }
-#endif
-
             if (ret < 0)
                 goto finish;
         }
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index ac40e197f62..b986aacc785 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -838,12 +838,10 @@  const char *av_disposition_to_string(int disposition);
  * sizeof(AVStream) must not be used outside libav*.
  */
 typedef struct AVStream {
-#if FF_API_AVSTREAM_CLASS
     /**
      * A class for @ref avoptions. Set on stream creation.
      */
     const AVClass *av_class;
-#endif
 
     int index;    /**< stream index in AVFormatContext */
     /**
diff --git a/libavformat/options.c b/libavformat/options.c
index 0079a06d9a5..c7681122cd7 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -257,10 +257,7 @@  AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
         return NULL;
     st = &sti->pub;
 
-#if FF_API_AVSTREAM_CLASS
     st->av_class = &stream_class;
-#endif
-
     st->codecpar = avcodec_parameters_alloc();
     if (!st->codecpar)
         goto fail;
diff --git a/libavformat/version_major.h b/libavformat/version_major.h
index 057d1ac0fb0..1db8e7600eb 100644
--- a/libavformat/version_major.h
+++ b/libavformat/version_major.h
@@ -42,7 +42,6 @@ 
  *
  */
 #define FF_API_COMPUTE_PKT_FIELDS2      (LIBAVFORMAT_VERSION_MAJOR < 60)
-#define FF_API_AVSTREAM_CLASS           (LIBAVFORMAT_VERSION_MAJOR > 59)
 #define FF_API_GET_END_PTS              (LIBAVFORMAT_VERSION_MAJOR < 60)
 #define FF_API_AVIODIRCONTEXT           (LIBAVFORMAT_VERSION_MAJOR < 60)