From c854102da773fa898cc6dbc8ca474b1088ce5f12 Mon Sep 17 00:00:00 2001 From: Nathan Caldwell Date: Thu, 18 Oct 2012 22:58:25 -0600 Subject: 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 --- libavcodec/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavcodec/utils.c') 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; -- cgit v1.2.1