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:

committed by
Luca Barbato

parent
a893655bda
commit
c854102da7
@@ -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;
|
||||
|
Reference in New Issue
Block a user