From fef3865ff203d222ae0f115610b4d5fdb0e2a3fb Mon Sep 17 00:00:00 2001 From: Sri Ramanujam Date: Sun, 12 Nov 2017 17:31:22 -0500 Subject: [PATCH] Fallback #ifdefs for older versions of libavcodec --- libfreerdp/codec/h264_ffmpeg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libfreerdp/codec/h264_ffmpeg.c b/libfreerdp/codec/h264_ffmpeg.c index 00182db..32ccafc 100644 --- a/libfreerdp/codec/h264_ffmpeg.c +++ b/libfreerdp/codec/h264_ffmpeg.c @@ -246,7 +246,11 @@ static int libavcodec_compress(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDs if (!libavcodec_create_encoder(h264)) return -1; +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(55, 39, 100) av_packet_unref(&sys->packet); +#else + av_free(sys->packet.data); +#endif av_init_packet(&sys->packet); sys->packet.data = NULL; sys->packet.size = 0; @@ -256,7 +260,9 @@ static int libavcodec_compress(H264_CONTEXT* h264, BYTE** ppDstData, UINT32* pDs #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 48, 100) sys->videoFrame->colorspace = AVCOL_SPC_BT709; #endif +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 92, 100) sys->videoFrame->chroma_location = AVCHROMA_LOC_LEFT; +#endif sys->videoFrame->data[0] = h264->pYUVData[0]; sys->videoFrame->data[1] = h264->pYUVData[1]; sys->videoFrame->data[2] = h264->pYUVData[2]; -- 2.7.4