=== modified file 'libmedia/ffmpeg/AudioDecoderFfmpeg.cpp'
--- libmedia/ffmpeg/AudioDecoderFfmpeg.cpp	2010-07-12 06:58:41 +0000
+++ libmedia/ffmpeg/AudioDecoderFfmpeg.cpp	2010-07-21 22:48:02 +0000
@@ -33,12 +33,6 @@
    and output buffers aligned to 16-byte boundaries */
 #define NEEDS_ALIGNED_MEMORY 1
 
-#ifdef FFMPEG_AUDIO2
-# define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
-#else
-# define AVCODEC_DECODE_AUDIO avcodec_decode_audio
-#endif
-
 namespace gnash {
 namespace media {
 namespace ffmpeg {
@@ -555,10 +549,11 @@
         inputSize, _audioCodecCtx->channels, _audioCodecCtx->frame_size);
 #endif
 
-    // older ffmpeg versions didn't accept a const input..
-	int tmp = AVCODEC_DECODE_AUDIO(_audioCodecCtx, outPtr, &outSize,
-                                   const_cast<boost::uint8_t*>(input),
-                                   inputSize);
+	AVPacket pkt; 
+	av_init_packet(&pkt); 
+	pkt.data = const_cast<boost::uint8_t*>(input); 
+	pkt.size = inputSize; 
+	int tmp = avcodec_decode_audio3(_audioCodecCtx, outPtr, &outSize, &pkt); 
 
 #ifdef GNASH_DEBUG_AUDIO_DECODING
 	log_debug(" avcodec_decode_audio[2](ctx, bufptr, %d, input, %d) "
@@ -680,13 +675,13 @@
 {
     if ( _needsParsing )
     {
-        return av_parser_parse(_parser, _audioCodecCtx,
+        return av_parser_parse2(_parser, _audioCodecCtx,
                     // as of 2008-10-28 SVN, ffmpeg doesn't
                     // accept a pointer to pointer to const..
                     const_cast<boost::uint8_t**>(outFrame),
                     outFrameSize,
                     input, inputSize,
-                    0, 0); // pts & dts
+                    0, 0, AV_NOPTS_VALUE); // pts & dts
     }
     else
     {

=== modified file 'libmedia/ffmpeg/AudioResamplerFfmpeg.cpp'
--- libmedia/ffmpeg/AudioResamplerFfmpeg.cpp	2010-01-25 18:52:20 +0000
+++ libmedia/ffmpeg/AudioResamplerFfmpeg.cpp	2010-07-21 22:31:50 +0000
@@ -46,9 +46,11 @@
 {
   if ( (ctx->sample_rate != 44100) || (ctx->channels != 2) ) {
     if ( ! _context ) {
-      _context = audio_resample_init( 
-		2, ctx->channels, 44100, ctx->sample_rate 
-	);
+      _context = av_audio_resample_init( 
+		2, ctx->channels, 
+		44100, ctx->sample_rate,
+		SAMPLE_FMT_S16, SAMPLE_FMT_S16,
+		16, 10, 0, 0.8);
     }
 
     return true;

=== modified file 'libmedia/ffmpeg/MediaParserFfmpeg.cpp'
--- libmedia/ffmpeg/MediaParserFfmpeg.cpp	2010-03-14 02:26:46 +0000
+++ libmedia/ffmpeg/MediaParserFfmpeg.cpp	2010-07-21 22:52:51 +0000
@@ -352,7 +352,7 @@
 			     "format");
     }
     
-    _formatCtx = av_alloc_format_context();
+    _formatCtx = avformat_alloc_context();
     assert(_formatCtx);
     
     // Setup the filereader/seeker mechanism. 7th argument (NULL) is the writer function,

=== modified file 'libmedia/ffmpeg/VideoDecoderFfmpeg.cpp'
--- libmedia/ffmpeg/VideoDecoderFfmpeg.cpp	2010-04-04 22:55:35 +0000
+++ libmedia/ffmpeg/VideoDecoderFfmpeg.cpp	2010-07-21 22:39:27 +0000
@@ -374,9 +374,13 @@
 
     int bytes = 0;    
     // no idea why avcodec_decode_video wants a non-const input...
-    avcodec_decode_video(_videoCodecCtx->getContext(), frame, &bytes,
-            const_cast<boost::uint8_t*>(input), input_size);
-    
+	AVPacket avp; 
+	av_init_packet( &avp );
+	avp.data = const_cast<boost::uint8_t*>(input);
+	avp.size = input_size;
+	
+    avcodec_decode_video2(_videoCodecCtx->getContext(), frame, &bytes, &avp);
+
     if (!bytes) {
         log_error("Decoding of a video frame failed");
         av_free(frame);

