summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2022-04-13 00:44:19 +0300
committerJan Ekström <jeebjp@gmail.com>2022-04-13 00:52:08 +0300
commit305332f8a06e174c5c45c9c4547293502ac7ecdb (patch)
tree96a2c8264391249c9f18b1cafcc706dd7f93ff06 /video/decode
parent1a597ea98744a92cd29e636ea440edd95ef7a142 (diff)
downloadmpv-305332f8a06e174c5c45c9c4547293502ac7ecdb.tar.bz2
mpv-305332f8a06e174c5c45c9c4547293502ac7ecdb.tar.xz
vd_lavc: fixup unchecked usage of AV_CODEC_EXPORT_DATA_FILM_GRAIN
This fixes build failures with avcodec 58.113.100 or before, matching FFmpeg release versions 4.0 to 4.3. This flag was added in between avcodec 58.113.100 and 58.114.100 during the FFmpeg 4.4 development cycle. It lacks its own version bump, so instead a check for the define is utilized instead. Additionally, warn the user if they request GPU film grain with too old of an FFmpeg. Fixes #10088
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index d6e0a0338c..31d57a6b44 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -698,6 +698,12 @@ static void init_avctx(struct mp_filter *vd)
if (lavc_codec->id == AV_CODEC_ID_H264 && lavc_param->old_x264)
av_opt_set(avctx, "x264_build", "150", AV_OPT_SEARCH_CHILDREN);
+#ifndef AV_CODEC_EXPORT_DATA_FILM_GRAIN
+ if (ctx->opts->film_grain == 1)
+ MP_WARN(vd, "GPU film grain requested, but FFmpeg too old to expose "
+ "film grain parameters. Please update to latest master, "
+ "or at least to release 4.4.\n");
+#else
switch(ctx->opts->film_grain) {
case 0: /*CPU*/
// default lavc flags handle film grain within the decoder.
@@ -720,6 +726,7 @@ static void init_avctx(struct mp_filter *vd)
break;
}
+#endif
mp_set_avopts(vd->log, avctx, lavc_param->avopts);