OSDN Git Service

make AVCodec.init() optional
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 1 Apr 2007 16:13:24 +0000 (16:13 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 1 Apr 2007 16:13:24 +0000 (16:13 +0000)
Originally committed as revision 8589 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/utils.c

index 619613f..4539cb9 100644 (file)
@@ -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--;