From 6a4992118a1fbf01becb1f25522f75b671f3a219 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 27 May 2020 16:55:45 +0200 Subject: [PATCH] lib/ffmpeg/Time: redefine AV_TIME_BASE_Q with initializer list libavutil's macro definition is a compound literal, which is illegal in C++. Fixes yet another -Wpedantic warning. --- src/lib/ffmpeg/Time.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/ffmpeg/Time.hxx b/src/lib/ffmpeg/Time.hxx index 52f6bc25f..03b8e8bce 100644 --- a/src/lib/ffmpeg/Time.hxx +++ b/src/lib/ffmpeg/Time.hxx @@ -36,6 +36,13 @@ extern "C" { #undef SampleFormat #endif +/* redefine AV_TIME_BASE_Q because libavutil's macro definition is a + compound literal, which is illegal in C++ */ +#ifdef AV_TIME_BASE_Q +#undef AV_TIME_BASE_Q +#endif +static constexpr AVRational AV_TIME_BASE_Q{1, AV_TIME_BASE}; + /** * Convert a FFmpeg time stamp to a floating point value (in seconds). */