From: Sri Ramanujam Date: Sun, 12 Nov 2017 22:31:22 +0000 (-0500) Subject: Fallback #ifdefs for older versions of libavcodec X-Git-Tag: 2.0.0-rc1~39^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fef3865ff203d222ae0f115610b4d5fdb0e2a3fb;p=platform%2Fupstream%2Ffreerdp.git Fallback #ifdefs for older versions of libavcodec --- 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];