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>
This commit is contained in:
Nathan Caldwell
2012-10-18 22:58:25 -06:00
committed by Luca Barbato
parent a893655bda
commit c854102da7
2 changed files with 23 additions and 19 deletions

View File

@@ -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;