From 327d413eb3c0c4cf07b71903eaa27e784be172c3 Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Tue, 7 Mar 2006 20:01:12 +0000 Subject: this patch features several cleanups and bugfixes for the sequencer: - blur works again (this was a serious bug in gamwarp...) - seperates all sequence effects into a seperate file with a clean interface - thereby fixing some obscure segfaults - seperates the scope views into a seperate file - adds float support to all effects and scope views - removes a bad level call to open_plugin_seq - FFMPEG seeking improved a lot. - FFMPEG compiles with debian sarge version cleanly - Makes hdaudio seek and resample code really work --- source/blender/imbuf/intern/util.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'source/blender/imbuf/intern/util.c') diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index fdb1bed3870..56a03f56ce2 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -217,6 +217,18 @@ void do_init_ffmpeg() } } +#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 (char *filename) { AVFormatContext *pFormatCtx; @@ -243,21 +255,14 @@ static int isffmpeg (char *filename) { /* Find the first video stream */ videoStream=-1; for(i=0; inb_streams; i++) -#ifdef FFMPEG_CODEC_IS_POINTER - if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO) -#else - if(pFormatCtx->streams[i]->codec.codec_type==CODEC_TYPE_VIDEO) -#endif + if(get_codec_from_stream(pFormatCtx->streams[i]) + ->codec_type==CODEC_TYPE_VIDEO) { videoStream=i; break; } -#ifdef FFMPEG_CODEC_IS_POINTER - pCodecCtx=pFormatCtx->streams[videoStream]->codec; -#else - pCodecCtx=&pFormatCtx->streams[videoStream]->codec; -#endif + pCodecCtx = get_codec_from_stream(pFormatCtx->streams[videoStream]); if(videoStream==-1) { avcodec_close(pCodecCtx); @@ -274,9 +279,6 @@ static int isffmpeg (char *filename) { return 0; } - if(pCodec->capabilities & CODEC_CAP_TRUNCATED) - pCodecCtx->flags|=CODEC_FLAG_TRUNCATED; - if(avcodec_open(pCodecCtx, pCodec)<0) { avcodec_close(pCodecCtx); av_close_input_file(pFormatCtx); -- cgit v1.2.3