--- modules/codec/ffmpeg/video.c.orig	2008-12-29 01:05:50.000000000 +0100
+++ modules/codec/ffmpeg/video.c	2008-12-29 01:08:17.000000000 +0100
@@ -259,13 +259,22 @@
     p_sys->p_context->codec_tag = ffmpeg_CodecTag( p_dec->fmt_in.i_codec );
     p_sys->p_context->width  = p_dec->fmt_in.video.i_width;
     p_sys->p_context->height = p_dec->fmt_in.video.i_height;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
     p_sys->p_context->bits_per_sample = p_dec->fmt_in.video.i_bits_per_pixel;
+#else
+    p_sys->p_context->bits_per_coded_sample = p_dec->fmt_in.video.i_bits_per_pixel;
+#endif
 
     /*  ***** Get configuration of ffmpeg plugin ***** */
     p_sys->p_context->workaround_bugs =
         config_GetInt( p_dec, "ffmpeg-workaround-bugs" );
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
     p_sys->p_context->error_resilience =
         config_GetInt( p_dec, "ffmpeg-error-resilience" );
+#else
+    p_sys->p_context->error_recognition =
+        config_GetInt( p_dec, "ffmpeg-error-resilience" );
+#endif
 
     var_Create( p_dec, "grayscale", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     var_Get( p_dec, "grayscale", &val );
--- modules/codec/ffmpeg/audio.c.orig	2008-12-29 01:26:11.000000000 +0100
+++ modules/codec/ffmpeg/audio.c	2008-12-29 01:27:15.000000000 +0100
@@ -111,7 +111,11 @@
     p_sys->p_context->channels = p_dec->fmt_in.audio.i_channels;
     p_sys->p_context->block_align = p_dec->fmt_in.audio.i_blockalign;
     p_sys->p_context->bit_rate = p_dec->fmt_in.i_bitrate;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
     p_sys->p_context->bits_per_sample = p_dec->fmt_in.audio.i_bitspersample;
+#else
+    p_sys->p_context->bits_per_coded_sample = p_dec->fmt_in.audio.i_bitspersample;
+#endif
 
     if( ( p_sys->p_context->extradata_size = p_dec->fmt_in.i_extra ) > 0 )
     {
--- modules/codec/ffmpeg/chroma.c.orig	2008-12-29 09:18:30.000000000 +0100
+++ modules/codec/ffmpeg/chroma.c	2008-12-29 09:24:53.000000000 +0100
@@ -54,7 +54,6 @@
     int i_dst_vlc_chroma;
     int i_dst_ffmpeg_chroma;
     AVPicture tmp_pic;
-    ImgReSampleContext *p_rsc;
 };
 
 /*****************************************************************************
--- modules/codec/ffmpeg/encoder.c.orig	2008-12-29 09:38:24.000000000 +0100
+++ modules/codec/ffmpeg/encoder.c	2008-12-29 10:01:18.000000000 +0100
@@ -504,8 +504,12 @@
 #endif
         }
 
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
         if ( p_sys->b_trellis )
             p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
+#else
+        p_context->trellis = p_sys->b_trellis;
+#endif
 
         if ( p_sys->i_qmin > 0 && p_sys->i_qmin == p_sys->i_qmax )
             p_context->flags |= CODEC_FLAG_QSCALE;
@@ -809,7 +813,11 @@
             if ( current_date + HURRY_UP_GUARD3 > frame.pts )
             {
                 p_sys->p_context->mb_decision = FF_MB_DECISION_SIMPLE;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
                 p_sys->p_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT;
+#else
+                p_sys->p_context->trellis = 0;
+#endif
                 msg_Dbg( p_enc, "hurry up mode 3" );
             }
             else
@@ -818,7 +826,11 @@
 
                 if ( current_date + HURRY_UP_GUARD2 > frame.pts )
                 {
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
                     p_sys->p_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT;
+#else
+                    p_sys->p_context->trellis = 0;
+#endif
 #if LIBAVCODEC_BUILD >= 4690
                     p_sys->p_context->noise_reduction = p_sys->i_noise_reduction
                          + (HURRY_UP_GUARD2 + current_date - frame.pts) / 500;
@@ -827,8 +839,12 @@
                 }
                 else
                 {
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
                     if ( p_sys->b_trellis )
                         p_sys->p_context->flags |= CODEC_FLAG_TRELLIS_QUANT;
+#else
+                    p_sys->p_context->trellis = p_sys->b_trellis;
+#endif
 #if LIBAVCODEC_BUILD >= 4690
                     p_sys->p_context->noise_reduction =
                         p_sys->i_noise_reduction;
--- modules/codec/ffmpeg/demux.c.orig	2008-12-29 11:00:02.000000000 +0100
+++ modules/codec/ffmpeg/demux.c	2008-12-29 11:07:31.000000000 +0100
@@ -162,7 +162,7 @@
                     (int (*) (URLContext *, unsigned char *, int))IORead;
     p_sys->url.prot->url_write = 0;
     p_sys->url.prot->url_seek =
-                    (offset_t (*) (URLContext *, offset_t, int))IOSeek;
+                    (int64_t (*) (URLContext *, int64_t, int))IOSeek;
     p_sys->url.prot->url_close = 0;
     p_sys->url.prot->next = 0;
     init_put_byte( &p_sys->io, p_sys->io_buffer, p_sys->io_buffer_size,
@@ -215,7 +215,11 @@
             es_format_Init( &fmt, AUDIO_ES, fcc );
             fmt.audio.i_channels = cc->channels;
             fmt.audio.i_rate = cc->sample_rate;
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
             fmt.audio.i_bitspersample = cc->bits_per_sample;
+#else
+            fmt.audio.i_bitspersample = cc->bits_per_coded_sample;
+#endif
             fmt.audio.i_blockalign = cc->block_align;
             break;
         case CODEC_TYPE_VIDEO:
@@ -464,7 +468,7 @@
     return i_ret ? i_ret : -1;
 }
 
-static offset_t IOSeek( void *opaque, offset_t offset, int whence )
+static int64_t IOSeek( void *opaque, offset_t offset, int whence )
 {
     URLContext *p_url = opaque;
     demux_t *p_demux = p_url->priv_data;
