[FFmpeg-cvslog] ffmpeg/lavc: move experimental warnings to libavcodec.
Michael Niedermayer
git at videolan.org
Mon Oct 22 18:12:22 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Oct 22 17:58:33 2012 +0200| [22793d7bb36e771dde1043d66f720ca7bacc7a1f] | committer: Michael Niedermayer
ffmpeg/lavc: move experimental warnings to libavcodec.
This way they are available to all applications and not just ffmpeg
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22793d7bb36e771dde1043d66f720ca7bacc7a1f
---
ffmpeg.c | 9 ---------
libavcodec/utils.c | 13 ++++++++++---
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 1612469..46e128a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -469,15 +469,6 @@ void assert_avoptions(AVDictionary *m)
static void abort_codec_experimental(AVCodec *c, int encoder)
{
- const char *codec_string = encoder ? "encoder" : "decoder";
- AVCodec *codec;
- av_log(NULL, AV_LOG_FATAL, "%s '%s' is experimental and might produce bad "
- "results.\nAdd '-strict experimental' if you want to use it.\n",
- codec_string, c->name);
- codec = encoder ? avcodec_find_encoder(c->id) : avcodec_find_decoder(c->id);
- if (!(codec->capabilities & CODEC_CAP_EXPERIMENTAL))
- av_log(NULL, AV_LOG_FATAL, "Or use the non experimental %s '%s'.\n",
- codec_string, codec->name);
exit(1);
}
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bed15bc..2ec28a7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -930,9 +930,16 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
- av_log(avctx, AV_LOG_ERROR,
- "Codec %s is experimental but experimental codecs are not enabled, try -strict %d\n",
- codec->name, FF_COMPLIANCE_EXPERIMENTAL);
+ const char *codec_string = av_codec_is_encoder(codec) ? "encoder" : "decoder";
+ AVCodec *codec2;
+ av_log(NULL, AV_LOG_ERROR,
+ "%s '%s' is experimental but experimental codecs are not enabled, "
+ "Add '-strict %d' if you want to use it.\n",
+ codec_string, codec->name, FF_COMPLIANCE_EXPERIMENTAL);
+ codec2 = av_codec_is_encoder(codec) ? avcodec_find_encoder(codec->id) : avcodec_find_decoder(codec->id);
+ if (!(codec2->capabilities & CODEC_CAP_EXPERIMENTAL))
+ av_log(NULL, AV_LOG_ERROR, "Or use the non experimental %s '%s'.\n",
+ codec_string, codec2->name);
ret = AVERROR_EXPERIMENTAL;
goto free_and_end;
}
More information about the ffmpeg-cvslog
mailing list