aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2012-10-18 22:58:25 -0600
committerLuca Barbato <lu_zero@gentoo.org>2012-10-21 23:03:26 +0200
commitc854102da773fa898cc6dbc8ca474b1088ce5f12 (patch)
treebabd340426cf4f8e658da03b18189088bd76d10d /libavcodec/utils.c
parenta893655bdaa726a82424367b6456d195be12ebbc (diff)
downloadffmpeg-c854102da773fa898cc6dbc8ca474b1088ce5f12.tar.gz
avcodec: handle AVERROR_EXPERIMENTAL
Error out on init if a codec with CODEC_CAP_EXPERIMENTAL is requested and strict_std_compliance is not FF_COMPLIANCE_EXPERIMENTAL. Move the check from avconv to avcodec_open2() and return AVERROR_EXPERIMENTAL accordingly. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index cbe527e5b3..5e22b9f6cf 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -778,6 +778,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
}
avctx->frame_number = 0;
+ if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
+ avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
+ ret = AVERROR_EXPERIMENTAL;
+ goto free_and_end;
+ }
+
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO &&
(!avctx->time_base.num || !avctx->time_base.den)) {
avctx->time_base.num = 1;