[FFmpeg-devel] [PATCH] lavu: make AV_TIME_BASE_Q work in C++ code

rcombs rcombs at rcombs.me
Wed Jun 24 22:09:58 EEST 2020


---
 libavutil/avutil.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavutil/avutil.h b/libavutil/avutil.h
index 4d633156d1..c11b33f466 100644
--- a/libavutil/avutil.h
+++ b/libavutil/avutil.h
@@ -257,7 +257,11 @@ const char *av_get_media_type_string(enum AVMediaType media_type);
  * Internal time base represented as fractional value
  */
 
+#ifdef __cplusplus
+#define AV_TIME_BASE_Q          AVRational{1, AV_TIME_BASE}
+#else
 #define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
+#endif
 
 /**
  * @}
-- 
2.27.0



More information about the ffmpeg-devel mailing list