Logo Search packages:      
Sourcecode: xmms-wma version File versions  Download package

int avcodec_open ( AVCodecContext avctx,
AVCodec codec 
)

opens / inits the AVCodecContext. not thread save!

Definition at line 391 of file utils.c.

References AVCodecContext::codec, AVCodecContext::codec_id, AVCodecContext::frame_number, AVCodec::id, AVCodec::init, AVCodecContext::priv_data, and AVCodec::priv_data_size.

{
    int ret;

    if(avctx->codec)
        return -1;

    avctx->codec = codec;
    avctx->codec_id = codec->id;
    avctx->frame_number = 0;
    if (codec->priv_data_size > 0) {
        avctx->priv_data = av_mallocz(codec->priv_data_size);
        if (!avctx->priv_data) 
            return -ENOMEM;
    } else {
        avctx->priv_data = NULL;
    }
    ret = avctx->codec->init(avctx);
    if (ret < 0) {
        av_freep(&avctx->priv_data);
        return ret;
    }
    return 0;
}


Generated by  Doxygen 1.6.0   Back to index