[Top][All Lists]
[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: |
Gabriele Giacone |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1172-g5c76984 |
Date: |
Sun, 11 Sep 2011 09:09:28 +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 5c76984eea636cdf301b70012a77d8d8e7f6e611 (commit)
from 4b95aac89c07bdfadab3b013220a1ef280893acf (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=5c76984eea636cdf301b70012a77d8d8e7f6e611
commit 5c76984eea636cdf301b70012a77d8d8e7f6e611
Author: Gabriele Giacone <address@hidden>
Date: Sun Sep 11 10:48:42 2011 +0200
Fix build on sid with libav 0.7.1.
Patch from http://savannah.gnu.org/bugs/?33696 adapted to support
older versions. Thanks chithead!
diff --git a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
index 2b1ce0e..98a7721 100644
--- a/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioDecoderFfmpeg.cpp
@@ -29,7 +29,11 @@
//#define GNASH_DEBUG_AUDIO_DECODING
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+#define AVCODEC_DECODE_AUDIO avcodec_decode_audio3
+#else
#define AVCODEC_DECODE_AUDIO avcodec_decode_audio2
+#endif
namespace gnash {
namespace media {
@@ -500,8 +504,18 @@ AudioDecoderFfmpeg::decodeFrame(const boost::uint8_t*
input,
#endif
// older ffmpeg versions didn't accept a const input..
+#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
input, inputSize);
+#endif
#ifdef GNASH_DEBUG_AUDIO_DECODING
log_debug(" avcodec_decode_audio[2](ctx, bufptr, %d, input, %d) "
@@ -609,13 +623,21 @@ AudioDecoderFfmpeg::parseInput(const boost::uint8_t*
input,
{
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
{
diff --git a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
index 3a43655..dc3f2f3 100644
--- a/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
+++ b/libmedia/ffmpeg/AudioResamplerFfmpeg.cpp
@@ -46,8 +46,15 @@ AudioResamplerFfmpeg::init( AVCodecContext* ctx )
{
if ( (ctx->sample_rate != 44100) || (ctx->channels != 2) ) {
if ( ! _context ) {
- _context = audio_resample_init(
- 2, ctx->channels, 44100, ctx->sample_rate
+#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 492d26d..be65b5e 100644
--- a/libmedia/ffmpeg/MediaParserFfmpeg.cpp
+++ b/libmedia/ffmpeg/MediaParserFfmpeg.cpp
@@ -429,7 +429,11 @@ MediaParserFfmpeg::initializeParser()
}
switch (enc->codec_type) {
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+ case AVMEDIA_TYPE_AUDIO:
+#else
case CODEC_TYPE_AUDIO:
+#endif
if (_audioStreamIndex < 0) {
_audioStreamIndex = i;
_audioStream = _formatCtx->streams[i];
@@ -440,7 +444,11 @@ MediaParserFfmpeg::initializeParser()
}
break;
+#if LIBAVCODEC_VERSION_MAJOR >= 53
+ case AVMEDIA_TYPE_VIDEO:
+#else
case CODEC_TYPE_VIDEO:
+#endif
if (_videoStreamIndex < 0) {
_videoStreamIndex = i;
_videoStream = _formatCtx->streams[i];
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index 0ddaf6c..bd3288a 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -356,8 +356,17 @@ VideoDecoderFfmpeg::decode(const boost::uint8_t* input,
int bytes = 0;
// no idea why avcodec_decode_video wants a non-const input...
+#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) {
log_error("Decoding of a video frame failed");
-----------------------------------------------------------------------
Summary of changes:
libmedia/ffmpeg/AudioDecoderFfmpeg.cpp | 22 ++++++++++++++++++++++
libmedia/ffmpeg/AudioResamplerFfmpeg.cpp | 11 +++++++++--
libmedia/ffmpeg/MediaParserFfmpeg.cpp | 8 ++++++++
libmedia/ffmpeg/VideoDecoderFfmpeg.cpp | 9 +++++++++
4 files changed, 48 insertions(+), 2 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1172-g5c76984,
Gabriele Giacone <=