Commit f05bf521 authored by michael's avatar michael

make AVCodec.init() optional


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8589 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 73809c5b
...@@ -829,12 +829,14 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec) ...@@ -829,12 +829,14 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
avctx->codec = codec; avctx->codec = codec;
avctx->codec_id = codec->id; avctx->codec_id = codec->id;
avctx->frame_number = 0; avctx->frame_number = 0;
if(avctx->codec->init){
ret = avctx->codec->init(avctx); ret = avctx->codec->init(avctx);
if (ret < 0) { if (ret < 0) {
av_freep(&avctx->priv_data); av_freep(&avctx->priv_data);
avctx->codec= NULL; avctx->codec= NULL;
goto end; goto end;
} }
}
ret=0; ret=0;
end: end:
entangled_thread_counter--; 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