From e1fbfd707c9e1df0223b3fd34ff064cad592dd91 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 22 Jul 2019 02:15:35 +0200 Subject: [PATCH] utility: Add function to check for broken property groups Even though property groups are supported in 23.x and above, there are quite a few bugs that result in completely bonkers behavior. So this function can be used to get the version of the currently running obs-studio. --- source/utility.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/utility.hpp b/source/utility.hpp index 6751a15..23288df 100644 --- a/source/utility.hpp +++ b/source/utility.hpp @@ -19,6 +19,11 @@ #include "version.hpp" +extern "C" { +#include +#include +} + // Logging #define PLOG(level, ...) blog(level, "[obs-ffmpeg-encoder] " __VA_ARGS__); #define PLOG_ERROR(...) PLOG(LOG_ERROR, __VA_ARGS__) @@ -71,3 +76,11 @@ static void f(void) __attribute__((constructor)); \ static void f(void) #endif + +// Helpers +namespace obsffmpeg { + bool inline are_property_groups_broken() + { + return obs_get_version() < MAKE_SEMANTIC_VERSION(24, 0, 0); + } +} // namespace obsffmpeg