python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / freerdp / 0004-ffmpeg30.patch
bloba7998b7894a458648cbb3598cde228f84e818347
1 From b7b66968f93f6ce75dd06d12638e14029bf3717b Mon Sep 17 00:00:00 2001
2 From: Alexis Ballier <aballier@gentoo.org>
3 Date: Thu, 17 Sep 2015 10:36:44 +0200
4 Subject: [PATCH] channels/tsmf/client/ffmpeg: Fix build with ffmpeg git
5 master.
7 Replace old, deprecated and now removed, APIs with their new equivalent while retaining backward compatibility with old ffmpeg versions.
9 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
10 [Downloaded from upstream commit:
11 https://github.com/FreeRDP/FreeRDP/commit/f8ceb3f6061583c650bd4f6cddc10bc0471f2076]
12 ---
13 channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 17 ++++++++++++++++-
14 1 file changed, 16 insertions(+), 1 deletion(-)
16 diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
17 index d0880e7..e1b9f83 100644
18 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
19 +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
20 @@ -61,6 +61,9 @@
21 #define AV_CODEC_ID_AC3 CODEC_ID_AC3
22 #endif
24 +#if LIBAVUTIL_VERSION_MAJOR < 52
25 +#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
26 +#endif
28 typedef struct _TSMFFFmpegDecoder
30 @@ -102,7 +105,11 @@ static BOOL tsmf_ffmpeg_init_video_stream(ITSMFDecoder* decoder, const TS_AM_MED
31 mdecoder->codec_context->bit_rate = media_type->BitRate;
32 mdecoder->codec_context->time_base.den = media_type->SamplesPerSecond.Numerator;
33 mdecoder->codec_context->time_base.num = media_type->SamplesPerSecond.Denominator;
34 +#if LIBAVCODEC_VERSION_MAJOR < 55
35 mdecoder->frame = avcodec_alloc_frame();
36 +#else
37 + mdecoder->frame = av_frame_alloc();
38 +#endif
39 return TRUE;
42 @@ -328,7 +335,11 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE *data, UI
43 if (!mdecoder->decoded_data)
44 return FALSE;
46 +#if LIBAVCODEC_VERSION_MAJOR < 55
47 frame = avcodec_alloc_frame();
48 +#else
49 + frame = av_frame_alloc();
50 +#endif
51 avpicture_fill((AVPicture*) frame, mdecoder->decoded_data,
52 mdecoder->codec_context->pix_fmt,
53 mdecoder->codec_context->width, mdecoder->codec_context->height);
54 @@ -400,7 +411,11 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE *data, UI
55 (int16_t *) dst, &frame_size, src, src_size);
56 #else
58 +#if LIBAVCODEC_VERSION_MAJOR < 55
59 AVFrame *decoded_frame = avcodec_alloc_frame();
60 +#else
61 + AVFrame *decoded_frame = av_frame_alloc();
62 +#endif
63 int got_frame = 0;
64 AVPacket pkt;
65 av_init_packet(&pkt);
66 @@ -480,7 +495,7 @@ static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder)
68 switch (mdecoder->codec_context->pix_fmt)
70 - case PIX_FMT_YUV420P:
71 + case AV_PIX_FMT_YUV420P:
72 return RDP_PIXFMT_I420;
73 default:
74 WLog_ERR(TAG, "unsupported pixel format %u",