[FFmpeg-devel] [PATCH v2] avutil: deprecate AVRational field inside AVOption::default_val

Zhao Zhili quinkblack at foxmail.com
Tue May 2 10:48:18 EEST 2023


From: Zhao Zhili <zhilizhao at tencent.com>

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
---
 libavutil/opt.h     | 2 ++
 libavutil/version.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/libavutil/opt.h b/libavutil/opt.h
index 461b5d3b6b..46915754ea 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -271,8 +271,10 @@ typedef struct AVOption {
         int64_t i64;
         double dbl;
         const char *str;
+#if FF_API_AVOPTION_AVRATIONAL
         /* TODO those are unused now */
         AVRational q;
+#endif
     } default_val;
     double min;                 ///< minimum valid value for the option
     double max;                 ///< maximum valid value for the option
diff --git a/libavutil/version.h b/libavutil/version.h
index 40f92af055..56af5c09c4 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -115,6 +115,7 @@
 #define FF_API_FRAME_PICTURE_NUMBER     (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_HDR_VIVID_THREE_SPLINE   (LIBAVUTIL_VERSION_MAJOR < 59)
 #define FF_API_FRAME_PKT                (LIBAVUTIL_VERSION_MAJOR < 59)
+#define FF_API_AVOPTION_AVRATIONAL      (LIBAVUTIL_VERSION_MAJOR < 59)
 
 /**
  * @}
-- 
2.40.1



More information about the ffmpeg-devel mailing list