diff options
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r-- | libavcodec/options.c | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |