diff options
author | Niklas Haas <git@haasn.dev> | 2022-09-28 02:28:37 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2022-09-28 02:28:37 +0200 |
commit | eba4ce5c2d103cb79c2bf7491e5de9a65190e7c2 (patch) | |
tree | 579eaba48fcfe165ef6219d259dbe95ad576e195 /video/mp_image.c | |
parent | 00813c76294350392d878053f1faa89cd56d8460 (diff) | |
download | mpv-eba4ce5c2d103cb79c2bf7491e5de9a65190e7c2.tar.bz2 mpv-eba4ce5c2d103cb79c2bf7491e5de9a65190e7c2.tar.xz |
mp_image: strip DoVi metadata that requires an EL
We can't support this. Better strip it than partially apply.
Fixes: #9831
Diffstat (limited to 'video/mp_image.c')
-rw-r--r-- | video/mp_image.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/video/mp_image.c b/video/mp_image.c index a4bf76f485..52c3f751f2 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -29,6 +29,10 @@ #include <libavcodec/avcodec.h> #include <libavutil/mastering_display_metadata.h> +#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 16, 100) +# include <libavutil/dovi_meta.h> +#endif + #include "mpv_talloc.h" #include "config.h" @@ -1012,8 +1016,14 @@ struct mp_image *mp_image_from_av_frame(struct AVFrame *src) #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 16, 100) sd = av_frame_get_side_data(src, AV_FRAME_DATA_DOVI_METADATA); - if (sd) - dst->dovi = sd->buf; + if (sd) { + // Strip DoVi metadata that requires an EL, since it's near-impossible + // for us to support easily or sanely + const AVDOVIMetadata *metadata = (AVDOVIMetadata *) sd->buf->data; + const AVDOVIRpuDataHeader *rpu = av_dovi_get_header(metadata); + if (rpu->disable_residual_flag) + dst->dovi = sd->buf; + } #endif #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 61, 100) |