gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1187-g426c9de
Date: Mon, 19 Sep 2011 18:36:07 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  426c9dea890036c668e7ad007c4459b7bba20b9a (commit)
      from  3d9edb9e27faee77725cf3498445d147a8c0aaf8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=426c9dea890036c668e7ad007c4459b7bba20b9a


commit 426c9dea890036c668e7ad007c4459b7bba20b9a
Author: Rob Savoye <address@hidden>
Date:   Mon Sep 19 12:35:19 2011 -0600

    forceably remove ubuntu patch as the revert seems to have not worked 
correctly.

diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index 20ed412..98a7721 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -30,9 +30,9 @@
 //#define GNASH_DEBUG_AUDIO_DECODING
 
 #if LIBAVCODEC_VERSION_MAJOR >= 53
-# define AVCODEC_DECODE_AUDIO avcodec_decode_audio3
+#define AVCODEC_DECODE_AUDIO avcodec_decode_audio3
 #else
-# define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
+#define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
 #endif
 
 namespace gnash {
@@ -504,22 +504,21 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t* 
input,
 #endif
 
     // older ffmpeg versions didn't accept a const input..
-#if !defined (LIBAVCODEC_VERSION_MAJOR) || LIBAVCODEC_VERSION_MAJOR < 53
-    int tmp = avcodec_decode_audio2(_audioCodecCtx, outPtr, &outSize,
-                                    input, inputSize);
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+    AVPacket pkt;
+    av_init_packet(&pkt);
+    pkt.data = (uint8_t*) input;
+    pkt.size = inputSize;
+#endif
+    int tmp = AVCODEC_DECODE_AUDIO(_audioCodecCtx, outPtr, &outSize,
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+                                   &pkt);
 #else
-    AVPacket packet;
-    av_init_packet(&packet);
-    // avcodec_decode_audio3 doesn't actually change packet.data
-    packet.data = const_cast<boost::uint8_t*>(input);
-    packet.size = inputSize;
-    int tmp = avcodec_decode_audio3(_audioCodecCtx, outPtr, &outSize, &packet);
-    packet.data = NULL;
-    av_free_packet(&packet);
+                                   input, inputSize);
 #endif
 
 #ifdef GNASH_DEBUG_AUDIO_DECODING
-    log_debug(" avcodec_decode_audio[23](ctx, bufptr, %d, input, %d) "
+    log_debug(" avcodec_decode_audio[2](ctx, bufptr, %d, input, %d) "
             "returned %d; set frame_size=%d",
             bufsize, inputSize, tmp, outSize);
 #endif
@@ -622,22 +621,26 @@ AudioDecoderFfmpeg::parseInput(const boost::uint8_t* 
input,
         boost::uint32_t inputSize,
         boost::uint8_t const ** outFrame, int* outFrameSize)
 {
-    if ( _needsParsing ) {
-#if !defined (LIBAVCODEC_VERSION_MAJOR) || LIBAVCODEC_VERSION_MAJOR < 53
-        return av_parser_parse(_parser, _audioCodecCtx,
-                               
reinterpret_cast<boost::uint8_t**>(outFrameSize),
-                               outFrameSize, input, inputSize,
-                               0, 0); // pts & dts
-#else
+    if ( _needsParsing )
+    {
+#if LIBAVCODEC_VERSION_MAJOR >= 53
         return av_parser_parse2(_parser, _audioCodecCtx,
+#else
+        return av_parser_parse(_parser, _audioCodecCtx,
+#endif
                     // 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,
+#if LIBAVCODEC_VERSION_MAJOR >= 53
                     0, 0, AV_NOPTS_VALUE); // pts, dts, pos
+#else
+                    0, 0); // pts & dts
 #endif
-    } else {
+    }
+    else
+    {
         // democratic value for a chunk to decode...
         // @todo this might be constrained by codec id, check that !
 
diff --git a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp 
b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
index 8fca013..dc3f2f3 100644
--- a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
@@ -18,19 +18,12 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
 #include "AudioResamplerFfmpeg.h"
 #include "log.h"
 
 #include <cmath>
 #include <vector>
 #include <boost/scoped_array.hpp>
-#ifdef HAVE_FFMPEG_AVCODEC_H
-# include <avcodec.h>
-#endif
 
 namespace gnash {
 namespace media {
@@ -53,14 +46,14 @@ AudioResamplerFfmpeg::init( AVCodecContext* ctx )
 {
   if ( (ctx->sample_rate != 44100) || (ctx->channels != 2) ) {
     if ( ! _context ) {
-#if !defined (LIBAVFORMAT_VERSION_MAJOR) || LIBAVFORMAT_VERSION_MAJOR < 53
-      _context = audio_resample_init(
-               2, ctx->channels, 44100, ctx->sample_rate
-#else        
+#if LIBAVCODEC_VERSION_MAJOR >= 53
       _context = av_audio_resample_init(
                2, ctx->channels, 44100, ctx->sample_rate,
                AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
                16, 10, 0, 0.8
+#else
+      _context = audio_resample_init(
+               2, ctx->channels, 44100, ctx->sample_rate
 #endif
        );
     }
diff --git a/libmedia/ffmpeg/MediaParserFfmpeg.cpp 
b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
index 7307531..be65b5e 100644
--- a/libmedia/ffmpeg/MediaParserFfmpeg.cpp
+++ b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
@@ -30,11 +30,6 @@
 // type is just "mixed/multipart"). Perhaps the codec will be configurable via
 // ActionScript sometime. - Udo 
 
-// Older versions of ffmpeg don't have this macros for converting version 
numbers.
-#ifndef AV_VERSION_INT
-# define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#endif
-
 namespace gnash {
 namespace media {
 namespace ffmpeg {
@@ -344,28 +339,12 @@ 
MediaParserFfmpeg::MediaParserFfmpeg(std::auto_ptr<IOChannel> stream)
 
 /*private*/
 void
-MediaParserFfmpeg::logMetadataEntry(const char *format, const char* key)
-{
-#if !defined (LIBAVCODEC_VERSION_INT) || LIBAVCODEC_VERSION_INT > 
AV_VERSION_INT( 51, 50, 0 )
-# if !defined (LIBAVFORMAT_VERSION_INT) || LIBAVFORMAT_VERSION_INT > 
AV_VERSION_INT( 51, 5, 0 )
-    const AVMetadataTag* entry = av_metadata_get(_formatCtx->metadata, key, 0, 
0);
-#else
-    const AVDictionaryEntry* entry = av_dict_get(_formatCtx->metadata, key, 0, 
0);
-#endif
-    if ( entry->value[0] ) {
-        log_debug(format, entry->value);
-    }
-#endif
-}
-void
 MediaParserFfmpeg::initializeParser()
 {
     av_register_all(); // TODO: needs to be invoked only once ?
 
-#if !defined (LIBAVFORMAT_VERSION_MAJOR) || LIBAVFORMAT_VERSION_MAJOR < 53
     _byteIOCxt.buffer = NULL;
-#endif
-
+    
     _inputFmt = probeStream();
 
 #ifdef GNASH_ALLOW_VCODEC_ENV  
@@ -386,7 +365,6 @@ MediaParserFfmpeg::initializeParser()
     // which isn't needed.
     _byteIOBuffer.reset(new unsigned char[byteIOBufferSize]);
 
-#if !defined (LIBAVFORMAT_VERSION_MAJOR) || LIBAVFORMAT_VERSION_MAJOR < 53
     init_put_byte(&_byteIOCxt,
                  _byteIOBuffer.get(), // buffer
                  byteIOBufferSize, // buffer size
@@ -398,19 +376,6 @@ MediaParserFfmpeg::initializeParser()
                  );
     
     _byteIOCxt.is_streamed = 1;
-#else
-    _formatCtx->pb = avio_alloc_context(
-        _byteIOBuffer.get(), // buffer
-        byteIOBufferSize, // buffer size
-        0, // write flags
-        this, // opaque pointer to pass to the callbacks
-        MediaParserFfmpeg::readPacketWrapper, // packet reader callback
-        NULL, // packet writer callback
-        MediaParserFfmpeg::seekMediaWrapper // seeker callback
-        );
-    
-    _formatCtx->pb->seekable = 0;
-#endif
 
 #if !defined(LIBAVCODEC_VERSION_MAJOR) || LIBAVCODEC_VERSION_MAJOR < 52
     // Needed for Lenny.
@@ -426,13 +391,7 @@ MediaParserFfmpeg::initializeParser()
     std::memset(&ap, 0, sizeof ap);
     ap.prealloced_context = 1;
 
-#if !defined (LIBAVFORMAT_VERSION_INT) || LIBAVFORMAT_VERSION_INT < 
AV_VERSION_INT (53, 2, 0)
-    // Open the stream. The 3rd argument is the filename, which we ignore.
-    if(av_open_input_stream(&_formatCtx, &_byteIOCxt, "", _inputFmt, NULL) < 0)
-#else
-    // Open the stream. The 2nd argument is the filename, which we ignore.
-    if(avformat_open_input(&_formatCtx, "", _inputFmt, NULL) < 0)
-#endif
+    if (av_open_input_stream(&_formatCtx, &_byteIOCxt, "", _inputFmt, &ap) < 0)
     {
         throw IOException("MediaParserFfmpeg couldn't open input stream");
     }
@@ -443,64 +402,64 @@ MediaParserFfmpeg::initializeParser()
     AVMetadata* md = _formatCtx->metadata;
     if (md) {
         AVMetadataTag* tag = av_metadata_get(md, "album", 0,
-                                             AV_METADATA_MATCH_CASE);
+                AV_METADATA_MATCH_CASE);
         if (tag && tag->value) {
             setId3Info(&Id3Info::album, std::string(tag->value),
                     _id3Object);
         }
     }
 #endif
-    
+
     log_debug("Parsing FFMPEG media file: format:%s; nstreams:%d",
-              _inputFmt->name, _formatCtx->nb_streams);
+        _inputFmt->name, _formatCtx->nb_streams);
     
     // Find first audio and video stream
     for (size_t i = 0; i < static_cast<size_t>(_formatCtx->nb_streams); ++i) {
-        
-        AVStream* stream = _formatCtx->streams[i];
-        if (! stream) {
+
+           AVStream* stream = _formatCtx->streams[i];
+           if (! stream) {
             log_debug("Stream %d of FFMPEG media file is null ?", i);
             continue;
-        }
-       
-        AVCodecContext* enc = stream->codec; 
-        if (!enc) {
+           }
+           
+           AVCodecContext* enc = stream->codec; 
+           if (!enc) {
             log_debug("Stream %d of FFMPEG media file has no codec info", i);
             continue;
-        }
-       
-        switch (enc->codec_type) {
+           }
+           
+           switch (enc->codec_type) {
 #if LIBAVCODEC_VERSION_MAJOR >= 53
-          case AVMEDIA_TYPE_AUDIO:
+            case AVMEDIA_TYPE_AUDIO:
 #else
-          case CODEC_TYPE_AUDIO:
+            case CODEC_TYPE_AUDIO:
 #endif
-              if (_audioStreamIndex < 0) {
-                  _audioStreamIndex = i;
-                  _audioStream = _formatCtx->streams[i];
-                  // codec_name will only be filled by avcodec_find_decoder
-                  // (later);
-                  log_debug(_("  Using stream %d for audio: codec id %d"),
-                            i, _audioStream->codec->codec_id);
-              }
-              break;
-              
+                if (_audioStreamIndex < 0) {
+                    _audioStreamIndex = i;
+                    _audioStream = _formatCtx->streams[i];
+                    // codec_name will only be filled by avcodec_find_decoder
+                    // (later);
+                    log_debug(_("  Using stream %d for audio: codec id %d"),
+                          i, _audioStream->codec->codec_id);
+                }
+                break;
+               
 #if LIBAVCODEC_VERSION_MAJOR >= 53
-          case AVMEDIA_TYPE_VIDEO:
+            case AVMEDIA_TYPE_VIDEO:
 #else
-          case CODEC_TYPE_VIDEO:
+            case CODEC_TYPE_VIDEO:
 #endif
-              if (_videoStreamIndex < 0) {
-                  _videoStreamIndex = i;
-                  _videoStream = _formatCtx->streams[i];
-                  log_debug(_("  Using stream %d for video: codec id %d"),
-                            i, _videoStream->codec->codec_id);
-              }
-              break;
-          default:
-              break;
-        }
-    }
+                if (_videoStreamIndex < 0) {
+                    _videoStreamIndex = i;
+                    _videoStream = _formatCtx->streams[i];
+                    log_debug(_("  Using stream %d for video: codec id %d"),
+                          i, _videoStream->codec->codec_id);
+                }
+                break;
+            default:
+                break;
+           }
+       }
     
     // Create VideoInfo
     if ( _videoStream) {
@@ -508,7 +467,7 @@ MediaParserFfmpeg::initializeParser()
         boost::uint16_t width = _videoStream->codec->width;
         boost::uint16_t height = _videoStream->codec->height;
         boost::uint16_t frameRate = static_cast<boost::uint16_t>(
-            as_double(_videoStream->r_frame_rate));
+                as_double(_videoStream->r_frame_rate));
 #if !defined(HAVE_LIBAVFORMAT_AVFORMAT_H) && !defined(HAVE_FFMPEG_AVCODEC_H)
         boost::uint64_t duration = _videoStream->codec_info_duration;
 #else
@@ -522,18 +481,18 @@ MediaParserFfmpeg::initializeParser()
         }
        
         _videoInfo.reset(new VideoInfo(codec, width, height, frameRate,
-                                       duration, CODEC_TYPE_CUSTOM /*codec 
type*/));
+                    duration, CODEC_TYPE_CUSTOM /*codec type*/));
        
         // NOTE: AVCodecContext.extradata : void* for 51.11.0, uint8_t* for 
51.38.0
         _videoInfo->extra.reset(new ExtraVideoInfoFfmpeg(
-                                    (uint8_t*)_videoStream->codec->extradata,
-                                    _videoStream->codec->extradata_size));
+                     (uint8_t*)_videoStream->codec->extradata,
+                     _videoStream->codec->extradata_size));
        
     }
     
     // Create AudioInfo
     if (_audioStream) {
-        
+
         const int codec = static_cast<int>(_audioStream->codec->codec_id); 
         boost::uint16_t sampleRate = _audioStream->codec->sample_rate;
         boost::uint16_t sampleSize = 
SampleFormatToSampleSize(_audioStream->codec->sample_fmt);
@@ -546,7 +505,8 @@ MediaParserFfmpeg::initializeParser()
         if (duration == AV_NOPTS_VALUE) {
             log_error("Duration of audio stream unknown to ffmpeg");
             duration=0; // TODO: guess!
-        } else {
+        } 
+        else {
             duration = duration / as_double(_audioStream->time_base); // TODO: 
check this
         }
        
@@ -565,19 +525,21 @@ MediaParserFfmpeg::initializeParser()
     
 MediaParserFfmpeg::~MediaParserFfmpeg()
 {
-    stopParserThread();
+       stopParserThread();
+
+       if ( _formatCtx )
+       {
+               // TODO: check if this is correct (should we create RIIA 
classes for ffmpeg stuff?)
+               //av_close_input_file(_formatCtx); // NOTE: this one triggers a 
mismatched free/delete on _byteIOBuffer with libavformat.so.52 !
+               av_free(_formatCtx);
+       }
+
+       if ( _inputFmt )
+       {
+               // TODO: check if this is correct (should we create RIIA 
classes for ffmpeg stuff?)
+               //av_free(_inputFmt); // it seems this one blows up, could be 
due to av_free(_formatCtx) above
+       }
 
-    if ( _formatCtx ) {
-        // TODO: check if this is correct (should we create RIIA classes for 
ffmpeg stuff?)
-        //av_close_input_file(_formatCtx); // NOTE: this one triggers a 
mismatched free/delete on _byteIOBuffer with libavformat.so.52 !
-        av_free(_formatCtx);
-    }
-    
-    if ( _inputFmt ) {
-        // TODO: check if this is correct (should we create RIIA classes for 
ffmpeg stuff?)
-        //av_free(_inputFmt); // it seems this one blows up, could be due to 
av_free(_formatCtx) above
-    }
-    
 }
 
 // NOTE: as this function is used as a callback from FFMPEG, it should not
@@ -588,13 +550,13 @@ MediaParserFfmpeg::~MediaParserFfmpeg()
 int 
 MediaParserFfmpeg::readPacket(boost::uint8_t* buf, int buf_size)
 {
-    //GNASH_REPORT_FUNCTION;
-    //log_debug("readPacket(%d)", buf_size);
-    
-    size_t ret = _stream->read(static_cast<void*>(buf), buf_size);
-    
-    return ret;
-    
+       //GNASH_REPORT_FUNCTION;
+       //log_debug("readPacket(%d)", buf_size);
+
+       size_t ret = _stream->read(static_cast<void*>(buf), buf_size);
+
+       return ret;
+
 }
 
 boost::optional<Id3Info>
@@ -611,77 +573,82 @@ MediaParserFfmpeg::getId3Info() const
 boost::int64_t 
 MediaParserFfmpeg::seekMedia(boost::int64_t offset, int whence)
 {
-    //GNASH_REPORT_FUNCTION;
-    //log_debug("::seekMedia(%1%, %2%)", offset, whence);
-    
-    assert(_stream.get());
-    
-    if (whence == SEEK_SET) {  
-        // Offset is absolute new position in the file
-        if ( offset < 0 ) {
-            boost::format fmt = boost::format(
-                _("MediaParserFfmpeg couldn't parse input format: "
-                  "tried to seek at negative offset %1%."))
-                % offset;
-            log_error(fmt);
-            return -1;
-        } else {
-            _stream->seek(offset);
-        }
-    } else if (whence == SEEK_CUR) {
-        // New position is offset + old position
-        _stream->seek(_stream->tell() + static_cast<std::streamoff>(offset));
-    } else if (whence == SEEK_END) {
-        // New position is offset + end of file
-        log_unimpl("MediaParserFfmpeg seek from end of file");
-        // This is (most likely) a streamed file, so we can't seek to the end!
-        // Instead we seek to byteIOBufferSize bytes... seems to work fine...
-        _stream->seek(byteIOBufferSize);
-        
-    } else {
-        // ffmpeg uses whence=AVSEEK_SIZE and offset=0 to request
-        // stream size !
-        log_unimpl("MediaParserFfmpeg: unsupported whence value %d", whence);
-        return -1;
-    }    
-    
-    return _stream->tell(); 
+       //GNASH_REPORT_FUNCTION;
+       //log_debug("::seekMedia(%1%, %2%)", offset, whence);
+
+       assert(_stream.get());
+
+       if (whence == SEEK_SET)
+       {       
+               // Offset is absolute new position in the file
+               if ( offset < 0 ) {
+                       boost::format fmt = boost::format(
+                               _("MediaParserFfmpeg couldn't parse input 
format: "
+                               "tried to seek at negative offset %1%."))
+                               % offset;
+                       log_error(fmt);
+                       return -1;
+               } else {
+                       _stream->seek(offset);
+               }
+       }
+       else if (whence == SEEK_CUR)
+       {
+               // New position is offset + old position
+               _stream->seek(_stream->tell() + 
static_cast<std::streamoff>(offset));
+       }
+       else if (whence == SEEK_END)
+       {
+               // New position is offset + end of file
+               log_unimpl("MediaParserFfmpeg seek from end of file");
+               // This is (most likely) a streamed file, so we can't seek to 
the end!
+               // Instead we seek to byteIOBufferSize bytes... seems to work 
fine...
+               _stream->seek(byteIOBufferSize);
+
+       }
+       else
+       {
+               // ffmpeg uses whence=AVSEEK_SIZE and offset=0 to request
+               // stream size !
+               log_unimpl("MediaParserFfmpeg: unsupported whence value %d", 
whence);
+               return -1;
+       }
+
+
+       return _stream->tell(); 
 }
 
 boost::uint16_t
 MediaParserFfmpeg::SampleFormatToSampleSize(SampleFormat fmt)
 {
-    switch (fmt) {
-      case SAMPLE_FMT_U8: // unsigned 8 bits
-          return 1;
-          
-      case SAMPLE_FMT_S16: // signed 16 bits
-      case SAMPLE_FMT_FLT: // float
-          return 2;
-          
+       switch (fmt)
+       {
+               case SAMPLE_FMT_U8: // unsigned 8 bits
+                       return 1;
+
+               case SAMPLE_FMT_S16: // signed 16 bits
+               case SAMPLE_FMT_FLT: // float
+                       return 2;
+
 #if !defined (LIBAVCODEC_VERSION_MAJOR) || LIBAVCODEC_VERSION_MAJOR < 52
 // Was dropped for version 52.0.0
-      case SAMPLE_FMT_S24: // signed 24 bits
-          return 3;
+               case SAMPLE_FMT_S24: // signed 24 bits
+                       return 3;
 #endif
-          
-      case SAMPLE_FMT_S32: // signed 32 bits
-          return 4;
-          
-      case SAMPLE_FMT_NONE:
-      default:
-          return 8; // arbitrary value
-    }
+
+               case SAMPLE_FMT_S32: // signed 32 bits
+                       return 4;
+
+               case SAMPLE_FMT_NONE:
+               default:
+                       return 8; // arbitrary value
+       }
 }
 
+
 } // gnash.media.ffmpeg namespace 
 } // end of gnash::media namespace
 } // end of gnash namespace
 
 #undef PADDING_BYTES
 #undef READ_CHUNKS 
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:
diff --git a/libmedia/ffmpeg/MediaParserFfmpeg.h 
b/libmedia/ffmpeg/MediaParserFfmpeg.h
index 2516f2d..a13cc30 100644
--- a/libmedia/ffmpeg/MediaParserFfmpeg.h
+++ b/libmedia/ffmpeg/MediaParserFfmpeg.h
@@ -92,14 +92,11 @@ public:
        // See dox in MediaParser.h
        virtual boost::uint64_t getBytesLoaded() const;
 
-        virtual boost::optional<Id3Info> getId3Info() const;
+    virtual boost::optional<Id3Info> getId3Info() const;
 
 private:
 
-        /// Log debugging information about a metadata entry
-        void logMetadataEntry(const char *format, const char* key);
-
-        /// Initialize parser, figuring format and 
+       /// Initialize parser, figuring format and 
        /// creating VideoInfo and AudioInfo objects
        void initializeParser();
 
@@ -156,9 +153,7 @@ private:
        AVStream* _audioStream;
 
        /// ?
-#if !defined (LIBAVFORMAT_VERSION_MAJOR) || LIBAVFORMAT_VERSION_MAJOR < 53
-        ByteIOContext _byteIOCxt;
-#endif
+       ByteIOContext _byteIOCxt;
 
        /// Size of the ByteIO context buffer
        //
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index 8549840..bd3288a 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -356,16 +356,16 @@ VideoDecoderFfmpeg::decode(const boost::uint8_t* input,
 
     int bytes = 0;    
     // no idea why avcodec_decode_video wants a non-const input...
-#if !defined (LIBAVFORMAT_VERSION_MAJOR) || LIBAVFORMAT_VERSION_MAJOR < 53
-    avcodec_decode_video(_videoCodecCtx->getContext(), frame, &bytes,
-                         input, input_size);
-#else
+#if LIBAVCODEC_VERSION_MAJOR >= 53
     AVPacket pkt;
     av_init_packet(&pkt);
     pkt.data = (uint8_t*) input;
     pkt.size = input_size;
     avcodec_decode_video2(_videoCodecCtx->getContext(), frame, &bytes,
             &pkt);
+#else
+    avcodec_decode_video(_videoCodecCtx->getContext(), frame, &bytes,
+            input, input_size);
 #endif
     
     if (!bytes) {
@@ -572,8 +572,3 @@ release_buffer(AVCodecContext *avctx, AVFrame *pic)
 } // gnash.media.ffmpeg namespace 
 } // gnash.media namespace 
 } // gnash namespace
-
-// local Variables:
-// mode: C++
-// indent-tabs-mode: nil
-// End:

-----------------------------------------------------------------------

Summary of changes:
 libmedia/ffmpeg/AudioDecoderFfmpeg.cpp   |   47 +++---
 libmedia/ffmpeg/AudioResamplerFfmpeg.cpp |   15 +-
 libmedia/ffmpeg/MediaParserFfmpeg.cpp    |  295 +++++++++++++-----------------
 libmedia/ffmpeg/MediaParserFfmpeg.h      |   11 +-
 libmedia/ffmpeg/VideoDecoderFfmpeg.cpp   |   13 +-
 5 files changed, 167 insertions(+), 214 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]