diff --git a/libavcodec/options.c b/libavcodec/options.c index 1d10128481..e1349dd3a8 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -102,6 +102,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) s->av_class = &av_codec_context_class; s->codec_type = codec ? codec->type : AVMEDIA_TYPE_UNKNOWN; + if (codec) + s->codec_id = codec->id; + if(s->codec_type == AVMEDIA_TYPE_AUDIO) flags= AV_OPT_FLAG_AUDIO_PARAM; else if(s->codec_type == AVMEDIA_TYPE_VIDEO)