diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-09 03:35:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-09 18:59:30 +0200 |
commit | adbe1d7de4463922042012f191136ccc776d8302 (patch) | |
tree | 27eb2ca7a0b393379fb491c42e4eeffdb9dceb62 | |
parent | dbbb31e5bb8889e96506a0831f2f34ea58dec8de (diff) | |
download | ffmpeg-adbe1d7de4463922042012f191136ccc776d8302.tar.gz |
avcodec/libopenjpegdec: Mark as experimental if <= 1.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/libopenjpegdec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 8fe7a506a0..7f28e87d7f 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -433,6 +433,15 @@ done: return ret; } +static av_cold void libopenjpeg_static_init(AVCodec *codec) +{ + const char *version = opj_version(); + int major, minor; + + if (sscanf(version, "%d.%d", &major, &minor) == 2 && 1000*major + minor <= 1003) + codec->capabilities |= CODEC_CAP_EXPERIMENTAL; +} + #define OFFSET(x) offsetof(LibOpenJPEGContext, x) #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM @@ -460,4 +469,5 @@ AVCodec ff_libopenjpeg_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS, .max_lowres = 31, .priv_class = &openjpeg_class, + .init_static_data = libopenjpeg_static_init, }; |