---- vlc-2.0.7/configure.ac.orig 2013-07-26 16:57:17.569390159 +0200
-+++ vlc-2.0.7/configure.ac 2013-07-26 20:30:33.175519230 +0200
-@@ -2416,9 +2416,6 @@
- [ --enable-avcodec libavcodec codec (default enabled)])
- AS_IF([test "${enable_avcodec}" != "no"], [
- PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 52.25.0 libavutil], [
-- PKG_CHECK_EXISTS([libavcodec < 55],, [
-- AC_MSG_ERROR([libavcodec versions 55 and later are not supported yet.])
-- ])
- VLC_SAVE_FLAGS
- CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
- CFLAGS="${CFLAGS} ${AVCODEC_CFLAGS}"
---- vlc-2.0.7/modules/codec/avcodec/avcodec.c.orig 2013-03-19 13:03:30.000000000 +0100
-+++ vlc-2.0.7/modules/codec/avcodec/avcodec.c 2013-07-26 21:19:58.625395411 +0200
-@@ -275,43 +275,44 @@
-
- /* Set CPU capabilities */
- unsigned i_cpu = vlc_CPU();
-- p_context->dsp_mask = 0;
-+ int cpu_flags = av_get_cpu_flags();
- if( !(i_cpu & CPU_CAPABILITY_MMX) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_MMX;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX;
- }
- if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
- }
- if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
-+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE2) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE2;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
- }
- #ifdef AV_CPU_FLAG_SSE3
- if( !(i_cpu & CPU_CAPABILITY_SSE3) )
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE3;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE3;
- #endif
- #ifdef AV_CPU_FLAG_SSSE3
- if( !(i_cpu & CPU_CAPABILITY_SSSE3) )
-- p_context->dsp_mask |= AV_CPU_FLAG_SSSE3;
-+ cpu_flags &= ~AV_CPU_FLAG_SSSE3;
- #endif
- #ifdef AV_CPU_FLAG_SSE4
- if( !(i_cpu & CPU_CAPABILITY_SSE4_1) )
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE4;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE4;
- #endif
- #ifdef AV_CPU_FLAG_SSE42
- if( !(i_cpu & CPU_CAPABILITY_SSE4_2) )
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE42;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE42;
- #endif
-+ av_force_cpu_flags(cpu_flags);
-
- p_dec->b_need_packetized = true;
- switch( i_cat )
---- vlc-2.0.7/modules/codec/avcodec/audio.c.orig 2013-04-25 18:41:41.000000000 +0200
-+++ vlc-2.0.7/modules/codec/avcodec/audio.c 2013-07-26 21:20:54.795393296 +0200
-@@ -228,8 +228,8 @@
- p_sys->i_output_max = 0;
- break;
- }
-- if( p_sys->i_output_max < 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE )
-- p_sys->i_output_max = 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE;
-+ if( p_sys->i_output_max < 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ )
-+ p_sys->i_output_max = 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */;
- msg_Dbg( p_dec, "Using %d bytes output buffer", p_sys->i_output_max );
- p_sys->p_output = av_malloc( p_sys->i_output_max );
-
---- vlc-2.0.7/modules/codec/avcodec/encoder.c.orig 2013-05-24 11:31:46.000000000 +0200
-+++ vlc-2.0.7/modules/codec/avcodec/encoder.c 2013-07-26 22:02:27.608621757 +0200
-@@ -359,23 +359,23 @@
-
- /* Set CPU capabilities */
- unsigned i_cpu = vlc_CPU();
-- p_context->dsp_mask = 0;
-+ int cpu_flags = av_get_cpu_flags();
- if( !(i_cpu & CPU_CAPABILITY_MMX) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_MMX;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX;
- }
- if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_MMX2;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
- }
- if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_3DNOW;
-+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE) )
- {
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE;
-- p_context->dsp_mask |= AV_CPU_FLAG_SSE2;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
- }
-
- p_sys->i_key_int = var_GetInteger( p_enc, ENC_CFG_PREFIX "keyint" );
-@@ -497,8 +497,6 @@
- p_context->dark_masking = p_sys->f_dark_masking;
- p_context->p_masking = p_sys->f_p_masking;
- p_context->border_masking = p_sys->f_border_masking;
-- p_context->luma_elim_threshold = p_sys->i_luma_elim;
-- p_context->chroma_elim_threshold = p_sys->i_chroma_elim;
-
- if( p_sys->i_key_int > 0 )
- p_context->gop_size = p_sys->i_key_int;
-@@ -512,7 +510,7 @@
- p_context->flags |= CODEC_FLAG_LOW_DELAY;
-
- if( p_enc->fmt_out.i_codec == VLC_CODEC_MP2V )
-- p_context->idct_algo = FF_IDCT_LIBMPEG2MMX;
-+ p_context->idct_algo = FF_IDCT_AUTO;
-
- av_reduce( &p_context->sample_aspect_ratio.num,
- &p_context->sample_aspect_ratio.den,
-@@ -804,7 +802,13 @@
- #if LIBAVCODEC_VERSION_MAJOR < 54
- ret = avcodec_open( p_context, p_codec );
- #else
-- ret = avcodec_open2( p_context, p_codec, NULL /* options */ );
-+ AVDictionary *opts = NULL;
-+ char buf[50];
-+ sprintf(buf, "%d", p_sys->i_luma_elim);
-+ av_dict_set(&opts, "lelim", buf, 0);
-+ sprintf(buf, "%d", p_sys->i_chroma_elim);
-+ av_dict_set(&opts, "celim", buf, 0);
-+ ret = avcodec_open2( p_context, p_codec, &opts );
- #endif
- vlc_avcodec_unlock();
- if( ret )
-@@ -885,7 +889,7 @@
- p_enc->fmt_out.audio.i_bitspersample = aout_BitsPerSample( vlc_fourcc_GetCodec( AUDIO_ES, p_enc->fmt_out.i_codec ) );
-
- if( p_context->frame_size > 1 )
-- p_sys->i_buffer_out = 8 * AVCODEC_MAX_AUDIO_FRAME_SIZE;
-+ p_sys->i_buffer_out = 8 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */;
- else
- p_sys->i_buffer_out = p_sys->i_frame_size * p_sys->i_sample_bytes;
- p_sys->p_buffer_out = malloc( p_sys->i_buffer_out );
---- vlc-2.0.8/modules/stream_out/switcher.c.orig 2013-06-18 00:07:53.000000000 +0200
-+++ vlc-2.0.8/modules/stream_out/switcher.c 2013-08-09 18:03:43.092571170 +0200
-@@ -361,27 +361,28 @@
-
- /* Set CPU capabilities */
- unsigned i_cpu = vlc_CPU();
-- id->ff_enc_c->dsp_mask = 0;
-+ int cpu_flags = av_get_cpu_flags();
- if( !(i_cpu & CPU_CAPABILITY_MMX) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX;
- }
- if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
- }
- if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
-+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE2) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
- }
-+ av_force_cpu_flags(cpu_flags);
-
- id->ff_enc_c->sample_rate = p_fmt->audio.i_rate;
- id->ff_enc_c->time_base.num = 1;
-@@ -404,7 +405,7 @@
- }
- vlc_avcodec_unlock();
-
-- id->p_buffer_out = malloc( AVCODEC_MAX_AUDIO_FRAME_SIZE * 2 );
-+ id->p_buffer_out = malloc( 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ * 2 );
- id->p_samples = calloc( id->ff_enc_c->frame_size * p_fmt->audio.i_channels,
- sizeof(int16_t) );
- if( !id->p_buffer_out || !id->p_samples )
-@@ -762,27 +763,28 @@
-
- /* Set CPU capabilities */
- unsigned i_cpu = vlc_CPU();
-- id->ff_enc_c->dsp_mask = 0;
-+ int cpu_flags = av_get_cpu_flags();
- if( !(i_cpu & CPU_CAPABILITY_MMX) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX;
- }
- if( !(i_cpu & CPU_CAPABILITY_MMXEXT) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_MMX2;
-+ cpu_flags &= ~AV_CPU_FLAG_MMX2;
- }
- if( !(i_cpu & CPU_CAPABILITY_3DNOW) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_3DNOW;
-+ cpu_flags &= ~AV_CPU_FLAG_3DNOW;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE;
- }
- if( !(i_cpu & CPU_CAPABILITY_SSE2) )
- {
-- id->ff_enc_c->dsp_mask |= AV_CPU_FLAG_SSE2;
-+ cpu_flags &= ~AV_CPU_FLAG_SSE2;
- }
-+ av_force_cpu_flags(cpu_flags);
-
- id->ff_enc_c->width = p_sys->p_pictures[p_sys->i_cmd-1].format.i_width;
- id->ff_enc_c->height = p_sys->p_pictures[p_sys->i_cmd-1].format.i_height;
-@@ -969,7 +971,7 @@
-
- (void)p_stream;
- i_out = avcodec_encode_audio( id->ff_enc_c, id->p_buffer_out,
-- 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE,
-+ 2 * 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */,
- id->p_samples );
-
- if ( i_out <= 0 )