diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-12-08 06:57:44 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-01-31 07:55:24 +0100 |
commit | af08d9aeea870de017139f7b1c44b7d816cf8e56 (patch) | |
tree | a94b59c3d1976b21855e9af7b847e4c81ecb062d /libavcodec/avcodec.h | |
parent | f7fe41a04f962707a99597d2ea49d73ca90b23a0 (diff) | |
download | ffmpeg-streaming-af08d9aeea870de017139f7b1c44b7d816cf8e56.zip ffmpeg-streaming-af08d9aeea870de017139f7b1c44b7d816cf8e56.tar.gz |
lavc: add avcodec_is_open().
It allows to check whether an AVCodecContext is open in a documented
way. Right now the undocumented way this check is done in lavf/lavc is
by checking whether AVCodecContext.codec is NULL. However it's desirable
to be able to set AVCodecContext.codec before avcodec_open2().
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a6bb686..284c7f8 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -4183,4 +4183,10 @@ enum AVMediaType avcodec_get_type(enum CodecID codec_id); */ const AVClass *avcodec_get_class(void); +/** + * @return a positive value if s is open (i.e. avcodec_open2() was called on it + * with no corresponding avcodec_close()), 0 otherwise. + */ +int avcodec_is_open(AVCodecContext *s); + #endif /* AVCODEC_AVCODEC_H */ |