comparison utils.c @ 1456:670fca257a69 libavcodec

detect avcodec_open() on an already opened AVCodecContext
author michaelni
date Wed, 10 Sep 2003 08:20:14 +0000
parents c4539ef4d8cb
children 010f76d07a27
comparison
equal deleted inserted replaced
1455:c4539ef4d8cb 1456:670fca257a69
303 303
304 int avcodec_open(AVCodecContext *avctx, AVCodec *codec) 304 int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
305 { 305 {
306 int ret; 306 int ret;
307 307
308 if(avctx->codec)
309 return -1;
310
308 avctx->codec = codec; 311 avctx->codec = codec;
309 avctx->codec_id = codec->id; 312 avctx->codec_id = codec->id;
310 avctx->frame_number = 0; 313 avctx->frame_number = 0;
311 if (codec->priv_data_size > 0) { 314 if (codec->priv_data_size > 0) {
312 avctx->priv_data = av_mallocz(codec->priv_data_size); 315 avctx->priv_data = av_mallocz(codec->priv_data_size);