Mercurial > libavcodec.hg
comparison utils.c @ 4762:4d346a3ea729 libavcodec
make AVCodec.init() optional
author | michael |
---|---|
date | Sun, 01 Apr 2007 16:13:24 +0000 |
parents | fc70a43a4f01 |
children | 28f41c99b704 |
comparison
equal
deleted
inserted
replaced
4761:4effe3bde31b | 4762:4d346a3ea729 |
---|---|
827 } | 827 } |
828 | 828 |
829 avctx->codec = codec; | 829 avctx->codec = codec; |
830 avctx->codec_id = codec->id; | 830 avctx->codec_id = codec->id; |
831 avctx->frame_number = 0; | 831 avctx->frame_number = 0; |
832 if(avctx->codec->init){ | |
832 ret = avctx->codec->init(avctx); | 833 ret = avctx->codec->init(avctx); |
833 if (ret < 0) { | 834 if (ret < 0) { |
834 av_freep(&avctx->priv_data); | 835 av_freep(&avctx->priv_data); |
835 avctx->codec= NULL; | 836 avctx->codec= NULL; |
836 goto end; | 837 goto end; |
838 } | |
837 } | 839 } |
838 ret=0; | 840 ret=0; |
839 end: | 841 end: |
840 entangled_thread_counter--; | 842 entangled_thread_counter--; |
841 return ret; | 843 return ret; |