avcodec/options: Set AVCodecContext->codec upon initialization.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/96/merge
Vadim Kalinsky 10 years ago committed by Michael Niedermayer
parent bccae39072
commit d1d3904273
  1. 4
      libavcodec/options.c

@ -95,8 +95,10 @@ 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)
if (codec) {
s->codec = codec;
s->codec_id = codec->id;
}
if(s->codec_type == AVMEDIA_TYPE_AUDIO)
flags= AV_OPT_FLAG_AUDIO_PARAM;

Loading…
Cancel
Save