From 2b5b7cb3c5764ad400b07639d1da9a5939def22b Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 9 Aug 2018 09:58:56 +0200 Subject: [PATCH] Added requirement check for WITH_DSP_FFMPEG --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a4c124..75eeba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -881,6 +881,20 @@ if (WITH_FFMPEG AND NOT FFMPEG_FOUND) endif() set(WITH_FFMPEG ${FFMPEG_FOUND}) +# Version check, if we have detected FFMPEG but the version is too old +# deactivate it as sound backend. +if (WITH_DSP_FFMPEG) + # Deactivate FFmpeg backend for sound, if the version is too old. + # See libfreerdp/codec/dsp_ffmpeg.h + check_symbol_exists(LIBAVCODEC_VERSION_MAJOR "libavcodec/version.h" AVCODEC_VERSION_MAJOR) + check_symbol_exists(LIBAVCODEC_VERSION_MINOR "libavcodec/version.h" AVCODEC_VERSION_MINOR) + check_symbol_exists(LIBAVCODEC_VERSION_MICRO "libavcodec/version.h" AVCODEC_VERSION_MICRO) + if (AVCODEC_VERSION_MAJOR LESS 57 OR AVCODEC_VERSION_MINOR LESS 48 OR AVCODEC_VERSION_MICRO LESS 101) + message("FFmpeg version detected ${}.${}.${} is too old. (Require at least 57.48.101 for sound). Deactivating") + set(WITH_DSP_FFMPEG OFF) + endif() +endif (WITH_DSP_FFMPEG) + if (WITH_OPENH264 AND NOT OPENH264_FOUND) message(FATAL_ERROR "OpenH264 support requested but not detected") endif() -- 2.7.4