From 5fa326532d31b8db2383c4dba938338cc5fb75d6 Mon Sep 17 00:00:00 2001 From: William Grzybowski Date: Fri, 25 Oct 2013 10:58:53 +0000 Subject: [PATCH] net/freerdp: fix build with ffmpeg - Fix build with ffmpeg Reported by: dinoex Approved by: portmgr (bapt, implicit) --- net/freerdp/Makefile | 11 ++---- ...channels-drdynvc-tsmf-ffmpeg-tsmf_ffmpeg.c | 36 +++++++++++++++++++ .../files/patch-cmake_FindFFmpeg.cmake | 26 -------------- 3 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 net/freerdp/files/patch-channels-drdynvc-tsmf-ffmpeg-tsmf_ffmpeg.c delete mode 100644 net/freerdp/files/patch-cmake_FindFFmpeg.cmake diff --git a/net/freerdp/Makefile b/net/freerdp/Makefile index e25b1489d621..072c38d7069e 100644 --- a/net/freerdp/Makefile +++ b/net/freerdp/Makefile @@ -61,15 +61,8 @@ CMAKE_ARGS+= -DWITH_ALSA=OFF .endif .if ${PORT_OPTIONS:MFFMPEG} -# the newer ffmpeg is prefered -LIB_DEPENDS+= avcodec-devel:${PORTSDIR}/multimedia/ffmpeg-devel \ - avutil-devel:${PORTSDIR}/multimedia/ffmpeg-devel -AVCODEC_INCLUDE_DIR= ${LOCALBASE}/include/ffmpeg-devel -AVCODEC_LIBRARY= ${LOCALBASE}/lib/ffmpeg-devel -AVUTIL_INCLUDE_DIR= ${AVCODEC_INCLUDE_DIR} -AVUTIL_LIBRARY= ${AVCODEC_LIBRARY} -CFLAGS+= -I${AVCODEC_INCLUDE_DIR} -LDFLAGS+= -I${AVCODEC_LIBRARY} +LIB_DEPENDS+= libavcodec.so:${PORTSDIR}/multimedia/ffmpeg \ + libavutil.so:${PORTSDIR}/multimedia/ffmpeg PLIST_SUB+= FFMPEG="" .else CMAKE_ARGS+= -DWITH_FFMPEG=OFF diff --git a/net/freerdp/files/patch-channels-drdynvc-tsmf-ffmpeg-tsmf_ffmpeg.c b/net/freerdp/files/patch-channels-drdynvc-tsmf-ffmpeg-tsmf_ffmpeg.c new file mode 100644 index 000000000000..ca85a5f2f39a --- /dev/null +++ b/net/freerdp/files/patch-channels-drdynvc-tsmf-ffmpeg-tsmf_ffmpeg.c @@ -0,0 +1,36 @@ +--- channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c.orig 2013-10-25 08:48:35.385869420 -0200 ++++ channels/drdynvc/tsmf/ffmpeg/tsmf_ffmpeg.c 2013-10-25 08:54:54.476872888 -0200 +@@ -34,12 +34,16 @@ + #define AVMEDIA_TYPE_AUDIO 1 + #endif + ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 ++#endif ++ + typedef struct _TSMFFFmpegDecoder + { + ITSMFDecoder iface; + + int media_type; +- enum CodecID codec_id; ++ enum AVCodecID codec_id; + AVCodecContext* codec_context; + AVCodec* codec; + AVFrame* frame; +@@ -89,13 +93,9 @@ + mdecoder->codec_context->block_align = media_type->BlockAlign; + + #ifdef AV_CPU_FLAG_SSE2 +- mdecoder->codec_context->dsp_mask = AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2; ++ av_set_cpu_flags_mask(AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2); + #else +-#if LIBAVCODEC_VERSION_MAJOR < 53 +- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMXEXT; +-#else +- mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMX2; +-#endif ++ av_set_cpu_flags_mask(FF_MM_SSE2 | FF_MM_MMX2); + #endif + + return true; diff --git a/net/freerdp/files/patch-cmake_FindFFmpeg.cmake b/net/freerdp/files/patch-cmake_FindFFmpeg.cmake deleted file mode 100644 index ee2c89c26693..000000000000 --- a/net/freerdp/files/patch-cmake_FindFFmpeg.cmake +++ /dev/null @@ -1,26 +0,0 @@ ---- cmake/FindFFmpeg.cmake.orig 2013-03-07 10:38:36.747254870 +0000 -+++ cmake/FindFFmpeg.cmake 2013-03-07 10:42:07.891253483 +0000 -@@ -8,19 +8,19 @@ - include(FindPkgConfig) - - if (PKG_CONFIG_FOUND) -- pkg_check_modules(AVCODEC libavcodec) -- pkg_check_modules(AVUTIL libavutil) -+ pkg_check_modules(AVCODEC libavcodec-devel) -+ pkg_check_modules(AVUTIL libavutil-devel) - endif ( PKG_CONFIG_FOUND ) - - # avcodec - find_path(AVCODEC_INCLUDE_DIR avcodec.h PATHS ${AVCODEC_INCLUDE_DIRS} - PATH_SUFFIXES libavcodec ) --find_library(AVCODEC_LIBRARY avcodec PATHS ${AVCODEC_LIBRARY_DIRS}) -+find_library(AVCODEC_LIBRARY avcodec-devel PATHS ${AVCODEC_LIBRARY_DIRS}) - - # avutil - find_path(AVUTIL_INCLUDE_DIR avutil.h PATHS ${AVUTIL_INCLUDE_DIRS} - PATH_SUFFIXES libavutil ) --find_library(AVUTIL_LIBRARY avutil PATHS ${AVUTIL_LIBRARY_DIRS}) -+find_library(AVUTIL_LIBRARY avutil-devel PATHS ${AVUTIL_LIBRARY_DIRS}) - - if(AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY) - set(AVCODEC_FOUND TRUE)