[FFmpeg-cvslog] lavu/rational: add syntactic sugar.

Nicolas George git at videolan.org
Sun Jan 19 17:56:55 CET 2014


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Tue Dec 31 14:07:25 2013 +0100| [3532dd52c51f3d4b95f31d1b195e64a04a8aea5d] | committer: Nicolas George

lavu/rational: add syntactic sugar.

Add a function to create a rational
and macros for common values.

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

 doc/APIchanges       |    3 +++
 libavutil/rational.h |   11 +++++++++++
 libavutil/version.h  |    2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d43f459..69a2c5a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil:     2012-10-22
 
 API changes, most recent first:
 
+2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
+  Add av_make_q() function.
+
 2013-12-xx - xxxxxxx - lavu 53.2.0 - frame.h
   Add AV_FRAME_DATA_MATRIXENCODING value to the AVFrameSideDataType enum, which
   identifies AVMatrixEncoding data.
diff --git a/libavutil/rational.h b/libavutil/rational.h
index b9800ee..7439701 100644
--- a/libavutil/rational.h
+++ b/libavutil/rational.h
@@ -46,6 +46,17 @@ typedef struct AVRational{
 } AVRational;
 
 /**
+ * Create a rational.
+ * Useful for compilers that do not support compound literals.
+ * @note  The return value is not reduced.
+ */
+static inline AVRational av_make_q(int num, int den)
+{
+    AVRational r = { num, den };
+    return r;
+}
+
+/**
  * Compare two rationals.
  * @param a first rational
  * @param b second rational
diff --git a/libavutil/version.h b/libavutil/version.h
index 9e4f202..1682f89 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  52
-#define LIBAVUTIL_VERSION_MINOR  62
+#define LIBAVUTIL_VERSION_MINOR  63
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list