Browse code

avutil: Add av_get_time_base_q()

This fixes usage of AV_TIME_BASE_Q in C++ applications, which
cannot use compound literals directly in their code.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Derek Buitenhuis authored on 2014/04/22 14:26:07
Showing 4 changed files
... ...
@@ -13,6 +13,9 @@ libavutil:     2013-12-xx
13 13
 
14 14
 API changes, most recent first:
15 15
 
16
+2014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
17
+  Add av_get_time_base_q().
18
+
16 19
 2014-04-xx - xxxxxxx - lavu 53.12.0 - crc.h
17 20
   Add AV_CRC_16_ANSI_LE crc variant.
18 21
 
... ...
@@ -240,6 +240,11 @@ enum AVMediaType {
240 240
 #define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
241 241
 
242 242
 /**
243
+ * Return the fractional representation of the internal time base.
244
+ */
245
+AVRational av_get_time_base_q(void);
246
+
247
+/**
243 248
  * @}
244 249
  * @}
245 250
  * @defgroup lavu_picture Image related
... ...
@@ -273,6 +278,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
273 273
  */
274 274
 
275 275
 #include "error.h"
276
+#include "rational.h"
276 277
 #include "version.h"
277 278
 #include "macros.h"
278 279
 
... ...
@@ -53,3 +53,8 @@ char av_get_picture_type_char(enum AVPictureType pict_type)
53 53
     default:                 return '?';
54 54
     }
55 55
 }
56
+
57
+AVRational av_get_time_base_q(void)
58
+{
59
+    return (AVRational){1, AV_TIME_BASE};
60
+}
... ...
@@ -54,7 +54,7 @@
54 54
  */
55 55
 
56 56
 #define LIBAVUTIL_VERSION_MAJOR 53
57
-#define LIBAVUTIL_VERSION_MINOR 12
57
+#define LIBAVUTIL_VERSION_MINOR 13
58 58
 #define LIBAVUTIL_VERSION_MICRO  0
59 59
 
60 60
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \