diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-18 14:29:11 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-18 14:29:11 +0400 |
commit | 0d64e050ea10ef9887323613c2fc6b429ebd53c9 (patch) | |
tree | 8954ec1670200f2f15e8379c9498e9f8a529802e /source/blender/imbuf | |
parent | 5e6e9bd616840cb1c9d4f41d333540f5294548e9 (diff) |
Reduce amount of deprecated symbols used from FFmpeg
This switches some areas of Blender which are related on FFmpeg stuff
from deprecated symbols to currently supported one.
Pretty straightforward changes based on documentation of FFmpeg's
API which symbols should be now used.
This should make Blender compatible with recent FFmpeg 0.11.
Should be no functional changes.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/indexer.c | 16 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 4 |
3 files changed, 11 insertions, 13 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 2370dbeebc5..f777d40dca9 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -445,7 +445,7 @@ static int startffmpeg(struct anim *anim) int i, videoStream; AVCodec *pCodec; - AVFormatContext *pFormatCtx; + AVFormatContext *pFormatCtx = NULL; AVCodecContext *pCodecCtx; int frs_num; double frs_den; @@ -464,7 +464,7 @@ static int startffmpeg(struct anim *anim) do_init_ffmpeg(); - if (av_open_input_file(&pFormatCtx, anim->name, NULL, 0, NULL) != 0) { + if (avformat_open_input(&pFormatCtx, anim->name, NULL, NULL) != 0) { return -1; } diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 11da2f4af91..0ccd2680461 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -531,13 +531,6 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->c->flags |= CODEC_FLAG_GLOBAL_HEADER; } - if (av_set_parameters(rv->of, NULL) < 0) { - fprintf(stderr, "Couldn't set output parameters? " - "Proxy not built!\n"); - av_free(rv->of); - return 0; - } - if (avio_open(&rv->of->pb, fname, AVIO_FLAG_WRITE) < 0) { fprintf(stderr, "Couldn't open outputfile! " "Proxy not built!\n"); @@ -574,7 +567,12 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( NULL, NULL, NULL); } - av_write_header(rv->of); + if (avformat_write_header(rv->of, NULL) < 0) { + fprintf(stderr, "Couldn't set output parameters? " + "Proxy not built!\n"); + av_free(rv->of); + return 0; + } return rv; } @@ -737,7 +735,7 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, IMB_Tim memset(context->proxy_ctx, 0, sizeof(context->proxy_ctx)); memset(context->indexer, 0, sizeof(context->indexer)); - if (av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) != 0) { + if (avformat_open_input(&context->iFormatCtx, anim->name, NULL, NULL) != 0) { MEM_freeN(context); return NULL; } diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index a86e2bed0e5..92c10a094d3 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -247,7 +247,7 @@ void do_init_ffmpeg(void) static int isffmpeg(const char *filename) { - AVFormatContext *pFormatCtx; + AVFormatContext *pFormatCtx = NULL; unsigned int i; int videoStream; AVCodec *pCodec; @@ -268,7 +268,7 @@ static int isffmpeg(const char *filename) return 0; } - if (av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL) != 0) { + if (avformat_open_input(&pFormatCtx, filename, NULL, NULL) != 0) { if (UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_open_input_file failed\n"); return 0; } |