History

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.

Derek Buitenhuis committed 12 years ago

Commit dac7e8a1 parent 6d149d24 files · +15 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/avutil.h +6 −0
  3. libavutil/utils.c +5 −0
  4. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2012-10-22 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2014-04-xx - xxxxxxx - lavu 53.13.0 / 52.78.100 - avutil.h
19+ Add av_get_time_base_q().
20+
1821 2014-04-xx - xxxxxxx - lavu 53.12.0 / 52.77.100 - crc.h
1922 Add AV_CRC_16_ANSI_LE crc variant.
2023
libavutil/avutil.h+6−0
@@ -246,6 +246,11 @@ const char *av_get_media_type_string(enum AVMediaType media_type); · 245 unmodified lines
246246
247247 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}
248248
249+/**
250+ * Return the fractional representation of the internal time base.
251+ */
252+AVRational av_get_time_base_q(void);
253+
249254 /**
250255 * @}
251256 * @}
@@ -282,6 +287,7 @@ char av_get_picture_type_char(enum AVPictureType pict_type); · 30 unmodified lines
282287
283288 #include "common.h"
284289 #include "error.h"
290+#include "rational.h"
285291 #include "version.h"
286292 #include "macros.h"
287293 #include "mathematics.h"
libavutil/utils.c+5−0
@@ -113,3 +113,8 @@ unsigned av_int_list_length_for_size(unsigned elsize, · 112 unmodified lines
113113 }
114114 return i;
115115 }
116+
117+AVRational av_get_time_base_q(void)
118+{
119+ return (AVRational){1, AV_TIME_BASE};
120+}
libavutil/version.h+1−1
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 */
5757
5858 #define LIBAVUTIL_VERSION_MAJOR 52
59−#define LIBAVUTIL_VERSION_MINOR 77
59+#define LIBAVUTIL_VERSION_MINOR 78
6060 #define LIBAVUTIL_VERSION_MICRO 100
6161
6262 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t