[FFmpeg-devel] [PATCH] avutil: deprecate AVRational field inside AVOption::default_val
Zhao Zhili
quinkblack at foxmail.com
Thu Oct 21 12:23:50 EEST 2021
It's not being used. For backward compatibility, AV_OPT_TYPE_RATIONAL
cannot be changed to use it.
---
libavutil/opt.h | 2 ++
libavutil/version.h | 3 +++
2 files changed, 5 insertions(+)
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 2820435eec..bf1a8b84fa 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -267,8 +267,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 896e348d80..4faea0cfcb 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -117,6 +117,9 @@
#ifndef FF_API_AV_MALLOCZ_ARRAY
#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
#endif
+#ifndef FF_API_AVOPTION_AVRATIONAL
+#define FF_API_AVOPTION_AVRATIONAL (LIBAVUTIL_VERSION_MAJOR < 58)
+#endif
/**
* @}
--
2.31.1
More information about the ffmpeg-devel
mailing list