summaryrefslogtreecommitdiff
path: root/libavcodec/options.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-01-28 19:15:15 +0100
committerAnton Khirnov <anton@khirnov.net>2012-01-31 16:53:35 +0100
commitbc901998487bf9b77a423961d9f961bcc28a9291 (patch)
tree10fc23398897ab2e4294e11d3af307d091b3beeb /libavcodec/options.c
parent0e72ad95f9fef6a6b8ae55e47339a5c40526502f (diff)
lavc: set AVCodecContext.codec in avcodec_get_context_defaults3().
This way, if the AVCodecContext is allocated for a specific codec, the caller doesn't need to store this codec separately and then pass it again to avcodec_open2(). It also allows to set codec private options using av_opt_set_* before opening the codec.
Diffstat (limited to 'libavcodec/options.c')
-rw-r--r--libavcodec/options.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 52fc66400a..eb803756fc 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -432,6 +432,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
s->av_class = &av_codec_context_class;
s->codec_type = codec ? codec->type : AVMEDIA_TYPE_UNKNOWN;
+ s->codec = codec;
av_opt_set_defaults(s);
s->time_base = (AVRational){0,1};