summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-09-10 08:20:14 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-09-10 08:20:14 +0000
commit09770af869dad68cff635256e7ff2e2596552efa (patch)
treef0d83c633690865366211b85c1a9d4f290f79559 /libavcodec
parentd9d8910bf280784e58beaf1b7a0f96497502e018 (diff)
downloadffmpeg-streaming-09770af869dad68cff635256e7ff2e2596552efa.zip
ffmpeg-streaming-09770af869dad68cff635256e7ff2e2596552efa.tar.gz
detect avcodec_open() on an already opened AVCodecContext
Originally committed as revision 2251 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f441ca2..050f26e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -305,6 +305,9 @@ int avcodec_open(AVCodecContext *avctx, AVCodec *codec)
{
int ret;
+ if(avctx->codec)
+ return -1;
+
avctx->codec = codec;
avctx->codec_id = codec->id;
avctx->frame_number = 0;
OpenPOWER on IntegriCloud