aboutsummaryrefslogtreecommitdiffstats
path: root/net/freerdp1/files/patch-ffmpeg29
blob: 6f644891961df6d030dc0519caefdd270a67d733 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
https://github.com/FreeRDP/FreeRDP/commit/b7b66968f93f

--- channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c.orig  2014-09-11 22:46:32 UTC
+++ channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
@@ -62,6 +62,9 @@
 #define AV_CODEC_ID_AC3 CODEC_ID_AC3
 #endif
 
+#if LIBAVUTIL_VERSION_MAJOR < 52
+#define AV_PIX_FMT_YUV420P PIX_FMT_YUV420P
+#endif
 
 typedef struct _TSMFFFmpegDecoder
 {
@@ -103,7 +106,11 @@ static BOOL tsmf_ffmpeg_init_video_stream(ITSMFDecoder
    mdecoder->codec_context->bit_rate = media_type->BitRate;
    mdecoder->codec_context->time_base.den = media_type->SamplesPerSecond.Numerator;
    mdecoder->codec_context->time_base.num = media_type->SamplesPerSecond.Denominator;
+#if LIBAVCODEC_VERSION_MAJOR < 55
    mdecoder->frame = avcodec_alloc_frame();
+#else
+   mdecoder->frame = av_frame_alloc();
+#endif
    return TRUE;
 }
 
@@ -322,7 +329,11 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder *dec
                                     mdecoder->codec_context->width, mdecoder->codec_context->height);
            mdecoder->decoded_data = malloc(mdecoder->decoded_size);
            ZeroMemory(mdecoder->decoded_data, mdecoder->decoded_size);
+#if LIBAVCODEC_VERSION_MAJOR < 55
            frame = avcodec_alloc_frame();
+#else
+           frame = av_frame_alloc();
+#endif
            avpicture_fill((AVPicture *) frame, mdecoder->decoded_data,
                           mdecoder->codec_context->pix_fmt,
                           mdecoder->codec_context->width, mdecoder->codec_context->height);
@@ -385,7 +396,11 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder *dec
                                    (int16_t *) dst, &frame_size, src, src_size);
 #else
        {
+#if LIBAVCODEC_VERSION_MAJOR < 55
            AVFrame *decoded_frame = avcodec_alloc_frame();
+#else
+           AVFrame *decoded_frame = av_frame_alloc();
+#endif
            int got_frame = 0;
            AVPacket pkt;
            av_init_packet(&pkt);
@@ -464,7 +479,7 @@ static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDeco
    TSMFFFmpegDecoder *mdecoder = (TSMFFFmpegDecoder *) decoder;
    switch(mdecoder->codec_context->pix_fmt)
    {
-       case PIX_FMT_YUV420P:
+       case AV_PIX_FMT_YUV420P:
            return RDP_PIXFMT_I420;
        default:
            CLOG_ERR("unsupported pixel format %u",