]> git.pld-linux.org Git - packages/vlc.git/blame - vlc-ffmpeg.patch
- updated to 2.0.8a
[packages/vlc.git] / vlc-ffmpeg.patch
CommitLineData
a14ebb2e
JB
1--- vlc-2.0.7/configure.ac.orig 2013-07-26 16:57:17.569390159 +0200
2+++ vlc-2.0.7/configure.ac 2013-07-26 20:30:33.175519230 +0200
3@@ -2416,9 +2416,6 @@
4 [ --enable-avcodec libavcodec codec (default enabled)])
5 AS_IF([test "${enable_avcodec}" != "no"], [
6 PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil], [
7- PKG_CHECK_EXISTS([libavcodec < 55],, [
8- AC_MSG_ERROR([libavcodec versions 55 and later are not supported yet.])
9- ])
10 VLC_SAVE_FLAGS
11 CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
12 CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
13--- vlc-2.0.7/modules/codec/avcodec/avcodec.c.orig 2013-03-19 13:03:30.000000000 +0100
14+++ vlc-2.0.7/modules/codec/avcodec/avcodec.c 2013-07-26 21:19:58.625395411 +0200
15@@ -275,43 +275,44 @@
16
17 /* Set CPU capabilities */
18 unsigned i_cpu = vlc_CPU();
19- p_context->dsp_mask = 0;
20+ int cpu_flags = av_get_cpu_flags();
21 if( !(i_cpu & CPU_CAPABILITY_MMX) )
22 {
23- p_context->dsp_mask |= AV_CPU_FLAG_MMX;
24+ cpu_flags &= ~AV_CPU_FLAG_MMX;
25 }
26 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
27 {
28- p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
29+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
30 }
31 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
32 {
33- p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
34+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
35 }
36 if( !(i_cpu & CPU_CAPABILITY_SSE) )
37 {
38- p_context->dsp_mask |= AV_CPU_FLAG_SSE;
39+ cpu_flags &= ~AV_CPU_FLAG_SSE;
40 }
41 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
42 {
43- p_context->dsp_mask |= AV_CPU_FLAG_SSE2;
44+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
45 }
46 #ifdef AV_CPU_FLAG_SSE3
47 if( !(i_cpu & CPU_CAPABILITY_SSE3) )
48- p_context->dsp_mask |= AV_CPU_FLAG_SSE3;
49+ cpu_flags &= ~AV_CPU_FLAG_SSE3;
50 #endif
51 #ifdef AV_CPU_FLAG_SSSE3
52 if( !(i_cpu & CPU_CAPABILITY_SSSE3) )
53- p_context->dsp_mask |= AV_CPU_FLAG_SSSE3;
54+ cpu_flags &= ~AV_CPU_FLAG_SSSE3;
55 #endif
56 #ifdef AV_CPU_FLAG_SSE4
57 if( !(i_cpu & CPU_CAPABILITY_SSE4_1) )
58- p_context->dsp_mask |= AV_CPU_FLAG_SSE4;
59+ cpu_flags &= ~AV_CPU_FLAG_SSE4;
60 #endif
61 #ifdef AV_CPU_FLAG_SSE42
62 if( !(i_cpu & CPU_CAPABILITY_SSE4_2) )
63- p_context->dsp_mask |= AV_CPU_FLAG_SSE42;
64+ cpu_flags &= ~AV_CPU_FLAG_SSE42;
65 #endif
66+ av_force_cpu_flags(cpu_flags);
67
68 p_dec->b_need_packetized = true;
69 switch( i_cat )
70--- vlc-2.0.7/modules/codec/avcodec/audio.c.orig 2013-04-25 18:41:41.000000000 +0200
71+++ vlc-2.0.7/modules/codec/avcodec/audio.c 2013-07-26 21:20:54.795393296 +0200
72@@ -228,8 +228,8 @@
73 p_sys->i_output_max = 0;
74 break;
75 }
76- if( p_sys->i_output_max < 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE )
77- p_sys->i_output_max = 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE;
78+ if( p_sys->i_output_max < 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ )
79+ p_sys->i_output_max = 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */;
80 msg_Dbg( p_dec, "Using %d bytes output buffer", p_sys->i_output_max );
81 p_sys->p_output = av_malloc( p_sys->i_output_max );
82
83--- vlc-2.0.7/modules/codec/avcodec/encoder.c.orig 2013-05-24 11:31:46.000000000 +0200
84+++ vlc-2.0.7/modules/codec/avcodec/encoder.c 2013-07-26 22:02:27.608621757 +0200
85@@ -359,23 +359,23 @@
86
87 /* Set CPU capabilities */
88 unsigned i_cpu = vlc_CPU();
89- p_context->dsp_mask = 0;
90+ int cpu_flags = av_get_cpu_flags();
91 if( !(i_cpu & CPU_CAPABILITY_MMX) )
92 {
93- p_context->dsp_mask |= AV_CPU_FLAG_MMX;
94+ cpu_flags &= ~AV_CPU_FLAG_MMX;
95 }
96 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
97 {
98- p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
99+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
100 }
101 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
102 {
103- p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
104+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
105 }
106 if( !(i_cpu & CPU_CAPABILITY_SSE) )
107 {
108- p_context->dsp_mask |= AV_CPU_FLAG_SSE;
109- p_context->dsp_mask |= AV_CPU_FLAG_SSE2;
110+ cpu_flags &= ~AV_CPU_FLAG_SSE;
111+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
112 }
113
114 p_sys->i_key_int = var_GetInteger( p_enc, ENC_CFG_PREFIX "keyint" );
115@@ -497,8 +497,6 @@
116 p_context->dark_masking = p_sys->f_dark_masking;
117 p_context->p_masking = p_sys->f_p_masking;
118 p_context->border_masking = p_sys->f_border_masking;
119- p_context->luma_elim_threshold = p_sys->i_luma_elim;
120- p_context->chroma_elim_threshold = p_sys->i_chroma_elim;
121
122 if( p_sys->i_key_int > 0 )
123 p_context->gop_size = p_sys->i_key_int;
124@@ -512,7 +510,7 @@
125 p_context->flags |= CODEC_FLAG_LOW_DELAY;
126
127 if( p_enc->fmt_out.i_codec == VLC_CODEC_MP2V )
128- p_context->idct_algo = FF_IDCT_LIBMPEG2MMX;
129+ p_context->idct_algo = FF_IDCT_AUTO;
130
131 av_reduce( &p_context->sample_aspect_ratio.num,
132 &p_context->sample_aspect_ratio.den,
133@@ -804,7 +802,13 @@
134 #if LIBAVCODEC_VERSION_MAJOR < 54
135 ret = avcodec_open( p_context, p_codec );
136 #else
137- ret = avcodec_open2( p_context, p_codec, NULL /* options */ );
138+ AVDictionary *opts = NULL;
139+ char buf[50];
140+ sprintf(buf, "%d", p_sys->i_luma_elim);
141+ av_dict_set(&opts, "lelim", buf, 0);
142+ sprintf(buf, "%d", p_sys->i_chroma_elim);
143+ av_dict_set(&opts, "celim", buf, 0);
144+ ret = avcodec_open2( p_context, p_codec, &opts );
145 #endif
146 vlc_avcodec_unlock();
147 if( ret )
148@@ -885,7 +889,7 @@
149 p_enc->fmt_out.audio.i_bitspersample = aout_BitsPerSample( vlc_fourcc_GetCodec( AUDIO_ES, p_enc->fmt_out.i_codec ) );
150
151 if( p_context->frame_size > 1 )
152- p_sys->i_buffer_out = 8 * AVCODEC_MAX_AUDIO_FRAME_SIZE;
153+ p_sys->i_buffer_out = 8 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */;
154 else
155 p_sys->i_buffer_out = p_sys->i_frame_size * p_sys->i_sample_bytes;
156 p_sys->p_buffer_out = malloc( p_sys->i_buffer_out );
e4b3c153
JB
157--- vlc-2.0.8/modules/stream_out/switcher.c.orig 2013-06-18 00:07:53.000000000 +0200
158+++ vlc-2.0.8/modules/stream_out/switcher.c 2013-08-09 18:03:43.092571170 +0200
159@@ -361,27 +361,28 @@
160
161 /* Set CPU capabilities */
162 unsigned i_cpu = vlc_CPU();
163- id->ff_enc_c->dsp_mask = 0;
164+ int cpu_flags = av_get_cpu_flags();
165 if( !(i_cpu & CPU_CAPABILITY_MMX) )
166 {
167- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
168+ cpu_flags &= ~AV_CPU_FLAG_MMX;
169 }
170 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
171 {
172- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
173+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
174 }
175 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
176 {
177- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
178+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
179 }
180 if( !(i_cpu & CPU_CAPABILITY_SSE) )
181 {
182- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
183+ cpu_flags &= ~AV_CPU_FLAG_SSE;
184 }
185 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
186 {
187- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
188+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
189 }
190+ av_force_cpu_flags(cpu_flags);
191
192 id->ff_enc_c->sample_rate = p_fmt->audio.i_rate;
193 id->ff_enc_c->time_base.num = 1;
194@@ -404,7 +405,7 @@
195 }
196 vlc_avcodec_unlock();
197
198- id->p_buffer_out = malloc( AVCODEC_MAX_AUDIO_FRAME_SIZE * 2 );
199+ id->p_buffer_out = malloc( 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ * 2 );
200 id->p_samples = calloc( id->ff_enc_c->frame_size * p_fmt->audio.i_channels,
201 sizeof(int16_t) );
202 if( !id->p_buffer_out || !id->p_samples )
203@@ -762,27 +763,28 @@
204
205 /* Set CPU capabilities */
206 unsigned i_cpu = vlc_CPU();
207- id->ff_enc_c->dsp_mask = 0;
208+ int cpu_flags = av_get_cpu_flags();
209 if( !(i_cpu & CPU_CAPABILITY_MMX) )
210 {
211- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
212+ cpu_flags &= ~AV_CPU_FLAG_MMX;
213 }
214 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
215 {
216- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
217+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
218 }
219 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
220 {
221- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
222+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
223 }
224 if( !(i_cpu & CPU_CAPABILITY_SSE) )
225 {
226- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
227+ cpu_flags &= ~AV_CPU_FLAG_SSE;
228 }
229 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
230 {
231- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
232+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
233 }
234+ av_force_cpu_flags(cpu_flags);
235
236 id->ff_enc_c->width = p_sys->p_pictures[p_sys->i_cmd-1].format.i_width;
237 id->ff_enc_c->height = p_sys->p_pictures[p_sys->i_cmd-1].format.i_height;
238@@ -969,7 +971,7 @@
239
240 (void)p_stream;
241 i_out = avcodec_encode_audio( id->ff_enc_c, id->p_buffer_out,
242- 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE,
243+ 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */,
244 id->p_samples );
245
246 if ( i_out <= 0 )
This page took 0.122132 seconds and 4 git commands to generate.