aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/options.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-21 11:57:28 +0200
committerAnton Khirnov <anton@khirnov.net>2016-05-23 06:46:17 +0200
commit04fc8e24a091ed1d77d7a3c0cbcfe60baec19a9f (patch)
treef46ae2e349459de2c1dec3ec7c3438cf158ef5bd /libavcodec/options.c
parent5f30ac27795f9f98043e8582ccaad8813104adc4 (diff)
downloadffmpeg-04fc8e24a091ed1d77d7a3c0cbcfe60baec19a9f.tar.gz
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.
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r--libavcodec/options.c11
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;
}