Added requirement check for WITH_DSP_FFMPEG
authorArmin Novak <armin.novak@thincast.com>
Thu, 9 Aug 2018 07:58:56 +0000 (09:58 +0200)
committerArmin Novak <armin.novak@thincast.com>
Thu, 9 Aug 2018 07:58:56 +0000 (09:58 +0200)
CMakeLists.txt

index 3a4c124..75eeba4 100644 (file)
@@ -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()