Commit 6e546aaa authored by Michael Niedermayer's avatar Michael Niedermayer

make AVCodec.init() optional

Originally committed as revision 8589 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent fa1ab872
......@@ -829,12 +829,14 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
avctx->codec = codec;
avctx->codec_id = codec->id;
avctx->frame_number = 0;
if(avctx->codec->init){
ret = avctx->codec->init(avctx);
if (ret < 0) {
av_freep(&avctx->priv_data);
avctx->codec= NULL;
goto end;
}
}
ret=0;
end:
entangled_thread_counter--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment