Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/freerdp/files: freerdp-1.1.0_beta1_p20130710-ffmpeg.patch
Date: Tue, 26 Nov 2013 01:58:50
Message-Id: 20131126015847.29D482004E@flycatcher.gentoo.org
1 floppym 13/11/26 01:58:47
2
3 Added: freerdp-1.1.0_beta1_p20130710-ffmpeg.patch
4 Log:
5 ffmpeg-2.0 compatibility fix, thanks to eroen on bug 481226.
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
8
9 Revision Changes Path
10 1.1 net-misc/freerdp/files/freerdp-1.1.0_beta1_p20130710-ffmpeg.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/freerdp/files/freerdp-1.1.0_beta1_p20130710-ffmpeg.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/freerdp/files/freerdp-1.1.0_beta1_p20130710-ffmpeg.patch?rev=1.1&content-type=text/plain
14
15 Index: freerdp-1.1.0_beta1_p20130710-ffmpeg.patch
16 ===================================================================
17 From bf065f3e892e0a94e442de9a7155a7ac170f2add Mon Sep 17 00:00:00 2001
18 From: eroen <eroen@××××××××××××.eu>
19 Date: Thu, 21 Nov 2013 11:35:53 +0100
20 Subject: [PATCH 1/3] ffmpeg-2 -- AVCODEC_MAX_AUDIO_FRAME_SIZE
21
22 deprecated:
23 http://git.videolan.org/?p=ffmpeg.git;a=commit;h=0eea212943544d40f99b05571aa7159d78667154
24
25 broken with libavcodec 54
26 ---
27 channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 10 ++++++++--
28 1 file changed, 8 insertions(+), 2 deletions(-)
29
30 diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
31 index adf8e04..0d5b956 100644
32 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
33 +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
34 @@ -43,6 +43,12 @@
35 #define AVMEDIA_TYPE_AUDIO 1
36 #endif
37
38 +#if LIBAVCODEC_VERSION_MAJOR < 54
39 +#define MAX_AUDIO_FRAME_SIZE AVCODEC_MAX_AUDIO_FRAME_SIZE
40 +#else
41 +#define MAX_AUDIO_FRAME_SIZE 192000
42 +#endif
43 +
44 typedef struct _TSMFFFmpegDecoder
45 {
46 ITSMFDecoder iface;
47 @@ -351,7 +357,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI
48 #endif
49
50 if (mdecoder->decoded_size_max == 0)
51 - mdecoder->decoded_size_max = AVCODEC_MAX_AUDIO_FRAME_SIZE + 16;
52 + mdecoder->decoded_size_max = MAX_AUDIO_FRAME_SIZE + 16;
53 mdecoder->decoded_data = malloc(mdecoder->decoded_size_max);
54 ZeroMemory(mdecoder->decoded_data, mdecoder->decoded_size_max);
55 /* align the memory for SSE2 needs */
56 @@ -363,7 +369,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, UI
57 while (src_size > 0)
58 {
59 /* Ensure enough space for decoding */
60 - if (mdecoder->decoded_size_max - mdecoder->decoded_size < AVCODEC_MAX_AUDIO_FRAME_SIZE)
61 + if (mdecoder->decoded_size_max - mdecoder->decoded_size < MAX_AUDIO_FRAME_SIZE)
62 {
63 mdecoder->decoded_size_max = mdecoder->decoded_size_max * 2 + 16;
64 mdecoder->decoded_data = realloc(mdecoder->decoded_data, mdecoder->decoded_size_max);
65 --
66 1.8.4
67
68
69 From cbcf0de3fac985afaeeef7daf104c94ad8cdca26 Mon Sep 17 00:00:00 2001
70 From: eroen <eroen@××××××××××××.eu>
71 Date: Thu, 21 Nov 2013 13:14:04 +0100
72 Subject: [PATCH 2/3] ffmpeg-2 -- dsp_mask
73
74 deprecated:
75 http://git.videolan.org/?p=ffmpeg.git;a=commit;h=95510be8c35753da8f48062b28b65e7acdab965f
76
77 broken with libavcodec 55
78 ---
79 channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 8 ++++++++
80 1 file changed, 8 insertions(+)
81
82 diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
83 index 0d5b956..1f99ec3 100644
84 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
85 +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
86 @@ -104,6 +104,7 @@ static BOOL tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MED
87 mdecoder->codec_context->channels = media_type->Channels;
88 mdecoder->codec_context->block_align = media_type->BlockAlign;
89
90 +#if LIBAVCODEC_VERSION_MAJOR < 55
91 #ifdef AV_CPU_FLAG_SSE2
92 mdecoder->codec_context->dsp_mask = AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2;
93 #else
94 @@ -113,6 +114,13 @@ static BOOL tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MED
95 mdecoder->codec_context->dsp_mask = FF_MM_SSE2 | FF_MM_MMX2;
96 #endif
97 #endif
98 +#else /* LIBAVCODEC_VERSION_MAJOR < 55 */
99 +#ifdef AV_CPU_FLAG_SSE2
100 + av_set_cpu_flags_mask(AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_MMX2);
101 +#else
102 + av_set_cpu_flags_mask(FF_MM_SSE2 | FF_MM_MMX2);
103 +#endif
104 +#endif /* LIBAVCODEC_VERSION_MAJOR < 55 */
105
106 return TRUE;
107 }
108 --
109 1.8.4
110
111
112 From 6fe23e1a3860528a8ecdfc8e9ccfdbd0e3945869 Mon Sep 17 00:00:00 2001
113 From: eroen <eroen@××××××××××××.eu>
114 Date: Thu, 21 Nov 2013 13:26:03 +0100
115 Subject: [PATCH 3/3] ffmpeg-2 -- CodecID
116
117 deprecated:
118 http://git.videolan.org/?p=ffmpeg.git;a=commit;h=104e10fb426f903ba9157fdbfe30292d0e4c3d72
119
120 broken with libavcodec 55
121 ---
122 channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c | 4 ++++
123 1 file changed, 4 insertions(+)
124
125 diff --git a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
126 index 1f99ec3..09b4f68 100644
127 --- a/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
128 +++ b/channels/tsmf/client/ffmpeg/tsmf_ffmpeg.c
129 @@ -54,7 +54,11 @@
130 ITSMFDecoder iface;
131
132 int media_type;
133 +#if LIBAVCODEC_VERSION_MAJOR < 55
134 enum CodecID codec_id;
135 +#else
136 + enum AVCodecID codec_id;
137 +#endif
138 AVCodecContext* codec_context;
139 AVCodec* codec;
140 AVFrame* frame;
141 --
142 1.8.4