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:38:33 -0400 |
commit | dac7e8a94e49e41f1dd0af34dc17d124d5b156ba (patch) | |
tree | 15fab86137f6c9f2b91f2e4925f3fb21c74e7123 /libavutil | |
parent | 6d149d28183a59a28143431f8e629484a52948b2 (diff) | |
download | ffmpeg-streaming-dac7e8a94e49e41f1dd0af34dc17d124d5b156ba.zip ffmpeg-streaming-dac7e8a94e49e41f1dd0af34dc17d124d5b156ba.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 d6566c1..3b644f9 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -247,6 +247,11 @@ const char *av_get_media_type_string(enum AVMediaType media_type); #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 @@ -282,6 +287,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type); #include "common.h" #include "error.h" +#include "rational.h" #include "version.h" #include "macros.h" #include "mathematics.h" diff --git a/libavutil/utils.c b/libavutil/utils.c index 4c82503..6c9b493 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -113,3 +113,8 @@ unsigned av_int_list_length_for_size(unsigned elsize, } return i; } + +AVRational av_get_time_base_q(void) +{ + return (AVRational){1, AV_TIME_BASE}; +} diff --git a/libavutil/version.h b/libavutil/version.h index 02015e3..832892b 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -56,7 +56,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 52 -#define LIBAVUTIL_VERSION_MINOR 77 +#define LIBAVUTIL_VERSION_MINOR 78 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |