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 <[email protected]>
---
 doc/APIchanges      | 3 +++
 libavutil/avutil.h  | 6 ++++++
 libavutil/utils.c   | 5 +++++
 libavutil/version.h | 2 +-
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 05f81b5..e163b56 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
+  Add av_get_time_base_q().
+
 2014-04-xx - xxxxxxx - lavu 53.12.0 - crc.h
   Add AV_CRC_16_ANSI_LE crc variant.
 
diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index a0d35d1..c0152b1 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -273,6 +273,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
  */
 
 #include "error.h"
+#include "rational.h"
 #include "version.h"
 #include "macros.h"
 
@@ -281,4 +282,9 @@ char av_get_picture_type_char(enum AVPictureType pict_type);
  * @}
  */
 
+/**
+ * Returns the fractional representation of the internal time base.
+ */
+AVRational av_get_time_base_q(void);
+
 #endif /* AVUTIL_AVUTIL_H */
diff --git a/libavutil/utils.c b/libavutil/utils.c
index 9b18c97..c8c161d 100644
--- a/libavutil/utils.c
+++ b/libavutil/utils.c
@@ -53,3 +53,8 @@ char av_get_picture_type_char(enum AVPictureType pict_type)
     default:                 return '?';
     }
 }
+
+AVRational av_get_time_base_q(void)
+{
+    return (AVRational){1, AV_TIME_BASE};
+}
diff --git a/libavutil/version.h b/libavutil/version.h
index f32e8d0..9d3e7f3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR 12
+#define LIBAVUTIL_VERSION_MINOR 13
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
1.9.2

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to