diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-04-22 07:26:07 +0200 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2014-04-22 16:32:35 -0400 |
commit | 502512ea0f179165782777265f441d4061ff6012 (patch) | |
tree | bb97af8a98ed8b57bac120ed28db76d4902595a6 /libavutil | |
parent | 9155c595f1a9c5a089a59e2c0aefdfabd0a6c59b (diff) | |
download | ffmpeg-502512ea0f179165782777265f441d4061ff6012.tar.gz |
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>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avutil.h | 6 | ||||
-rw-r--r-- | libavutil/utils.c | 5 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h index a0d35d1627..8c6e571f62 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -240,6 +240,11 @@ enum AVMediaType { #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} /** + * Return the fractional representation of the internal time base. + */ +AVRational av_get_time_base_q(void); + +/** * @} * @} * @defgroup lavu_picture Image related @@ -273,6 +278,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "error.h" +#include "rational.h" #include "version.h" #include "macros.h" diff --git a/libavutil/utils.c b/libavutil/utils.c index 9b18c97908..c8c161dccb 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 f32e8d06e3..9d3e7f31fc 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, \ |