From 04fc8e24a091ed1d77d7a3c0cbcfe60baec19a9f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 21 May 2016 11:57:28 +0200 Subject: lavc: deprecate avcodec_get_context_defaults3() This function is supposed to "reset" a codec context to a clean state so that it can be opened again. The only reason it exists is to allow using AVStream.codec as a decoding context (after it was already opened/used/closed by avformat_find_stream_info()). Since that behaviour is now deprecated, there is no reason for this function to exist anymore. --- libavcodec/options.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libavcodec/options.c') diff --git a/libavcodec/options.c b/libavcodec/options.c index 50bacd3df8..117ae5e445 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -80,7 +80,7 @@ static const AVClass av_codec_context_class = { .child_class_next = codec_child_class_next, }; -int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) +static int init_context_defaults(AVCodecContext *s, const AVCodec *codec) { memset(s, 0, sizeof(AVCodecContext)); @@ -125,6 +125,13 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) return 0; } +#if FF_API_GET_CONTEXT_DEFAULTS +int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) +{ + return init_context_defaults(s, codec); +} +#endif + AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) { AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); @@ -132,7 +139,7 @@ AVCodecContext *avcodec_alloc_context3(const AVCodec *codec) if (!avctx) return NULL; - if(avcodec_get_context_defaults3(avctx, codec) < 0){ + if (init_context_defaults(avctx, codec) < 0) { av_free(avctx); return NULL; } -- cgit v1.2.3