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
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.])
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
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) )
23 - p_context->dsp_mask |= AV_CPU_FLAG_MMX;
24 + cpu_flags &= ~AV_CPU_FLAG_MMX;
26 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
28 - p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
29 + cpu_flags &= ~AV_CPU_FLAG_MMX2;
31 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
33 - p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
34 + cpu_flags &= ~AV_CPU_FLAG_3DNOW;
36 if( !(i_cpu & CPU_CAPABILITY_SSE) )
38 - p_context->dsp_mask |= AV_CPU_FLAG_SSE;
39 + cpu_flags &= ~AV_CPU_FLAG_SSE;
41 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
43 - p_context->dsp_mask |= AV_CPU_FLAG_SSE2;
44 + cpu_flags &= ~AV_CPU_FLAG_SSE2;
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;
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;
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;
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;
66 + av_force_cpu_flags(cpu_flags);
68 p_dec->b_need_packetized = true;
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
73 p_sys->i_output_max = 0;
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 );
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
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) )
93 - p_context->dsp_mask |= AV_CPU_FLAG_MMX;
94 + cpu_flags &= ~AV_CPU_FLAG_MMX;
96 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
98 - p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
99 + cpu_flags &= ~AV_CPU_FLAG_MMX2;
101 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
103 - p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
104 + cpu_flags &= ~AV_CPU_FLAG_3DNOW;
106 if( !(i_cpu & CPU_CAPABILITY_SSE) )
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;
114 p_sys->i_key_int = var_GetInteger( p_enc, ENC_CFG_PREFIX "keyint" );
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;
122 if( p_sys->i_key_int > 0 )
123 p_context->gop_size = p_sys->i_key_int;
125 p_context->flags |= CODEC_FLAG_LOW_DELAY;
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;
131 av_reduce( &p_context->sample_aspect_ratio.num,
132 &p_context->sample_aspect_ratio.den,
134 #if LIBAVCODEC_VERSION_MAJOR < 54
135 ret = avcodec_open( p_context, p_codec );
137 - ret = avcodec_open2( p_context, p_codec, NULL /* options */ );
138 + AVDictionary *opts = NULL;
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 );
146 vlc_avcodec_unlock();
149 p_enc->fmt_out.audio.i_bitspersample = aout_BitsPerSample( vlc_fourcc_GetCodec( AUDIO_ES, p_enc->fmt_out.i_codec ) );
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 */;
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 );
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 @@
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) )
167 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
168 + cpu_flags &= ~AV_CPU_FLAG_MMX;
170 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
172 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
173 + cpu_flags &= ~AV_CPU_FLAG_MMX2;
175 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
177 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
178 + cpu_flags &= ~AV_CPU_FLAG_3DNOW;
180 if( !(i_cpu & CPU_CAPABILITY_SSE) )
182 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
183 + cpu_flags &= ~AV_CPU_FLAG_SSE;
185 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
187 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
188 + cpu_flags &= ~AV_CPU_FLAG_SSE2;
190 + av_force_cpu_flags(cpu_flags);
192 id->ff_enc_c->sample_rate = p_fmt->audio.i_rate;
193 id->ff_enc_c->time_base.num = 1;
196 vlc_avcodec_unlock();
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,
202 if( !id->p_buffer_out || !id->p_samples )
203 @@ -762,27 +763,28 @@
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) )
211 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
212 + cpu_flags &= ~AV_CPU_FLAG_MMX;
214 if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
216 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
217 + cpu_flags &= ~AV_CPU_FLAG_MMX2;
219 if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
221 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
222 + cpu_flags &= ~AV_CPU_FLAG_3DNOW;
224 if( !(i_cpu & CPU_CAPABILITY_SSE) )
226 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
227 + cpu_flags &= ~AV_CPU_FLAG_SSE;
229 if( !(i_cpu & CPU_CAPABILITY_SSE2) )
231 - id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
232 + cpu_flags &= ~AV_CPU_FLAG_SSE2;
234 + av_force_cpu_flags(cpu_flags);
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;
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 */,