diff options
author | Peter Schlaile <peter@schlaile.de> | 2011-05-27 01:57:02 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2011-05-27 01:57:02 +0400 |
commit | 4b9a63c6d3b6fc90259bea708355d678d3681bc3 (patch) | |
tree | 383ebf3f75fdd8ef54103ccfd655f5a7cfd129c4 /source/blender/imbuf/intern/util.c | |
parent | 78b8e4a437b34a3956283dae08a6718a01b00e63 (diff) |
== FFMPEG ==
* removed a lot of old cruft code for ancient ffmpeg versions
* made it compile again against latest ffmpeg / libav GIT
(also shouldn't break distro ffmpegs, since those API changes
have been introduced over a year ago. If it nevertheless breaks,
please send me an email)
Diffstat (limited to 'source/blender/imbuf/intern/util.c')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 3e4136cbef9..879ed37cc50 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -62,13 +62,6 @@ #include <libavformat/avformat.h> #include <libavdevice/avdevice.h> #include <libavutil/log.h> - -#if LIBAVFORMAT_VERSION_INT < (49 << 16) -#define FFMPEG_OLD_FRAME_RATE 1 -#else -#define FFMPEG_CODEC_IS_POINTER 1 -#endif - #endif #define UTIL_DEBUG 0 @@ -241,19 +234,6 @@ void do_init_ffmpeg(void) } } -#ifdef FFMPEG_CODEC_IS_POINTER -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return stream->codec; -} -#else -static AVCodecContext* get_codec_from_stream(AVStream* stream) -{ - return &stream->codec; -} -#endif - - static int isffmpeg (const char *filename) { AVFormatContext *pFormatCtx; unsigned int i; @@ -284,15 +264,15 @@ static int isffmpeg (const char *filename) { return 0; } - if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0); + if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0); /* Find the first video stream */ videoStream=-1; for(i=0; i<pFormatCtx->nb_streams; i++) if(pFormatCtx->streams[i] && - get_codec_from_stream(pFormatCtx->streams[i]) && - (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO)) + pFormatCtx->streams[i]->codec && + (pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)) { videoStream=i; break; @@ -303,7 +283,7 @@ static int isffmpeg (const char *filename) { return 0; } - pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]); + pCodecCtx = pFormatCtx->streams[videoStream]->codec; /* Find the decoder for the video stream */ pCodec=avcodec_find_decoder(pCodecCtx->codec_id); |