summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-07-25 23:06:27 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-03 21:48:25 +0200
commit1aab0376014ff7fc278a81847c989b3970aa0736 (patch)
tree3942c4563227490bdb9afc7ba9ce845f0db1da22 /video/decode
parent0f956f0929bacd6f4ad1a8c8ad4892ee14001b2d (diff)
downloadmpv-1aab0376014ff7fc278a81847c989b3970aa0736.tar.bz2
mpv-1aab0376014ff7fc278a81847c989b3970aa0736.tar.xz
vd_lavc: decode embedded ICC profiles
Since these need to be refcounted, we throw them directly into struct mp_image instead of being part of mp_colorspace. Even though they would semantically make more sense in mp_colorspace, having them there is really awkward because mp_colorspace is passed around and stored a lot, and this way their lifetime is exactly tied to the lifetime of the mp_image associated with it.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index f1b2a83749..9c09d0a9c5 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -1184,6 +1184,12 @@ static bool decode_frame(struct dec_video *vd)
mp_pts_from_av(av_frame_get_pkt_duration(ctx->pic), &ctx->codec_timebase);
#endif
+#if HAVE_AVUTIL_ICC_PROFILE
+ sd = av_frame_get_side_data(ctx->pic, AV_FRAME_DATA_ICC_PROFILE);
+ if (sd)
+ mpi->icc_profile = av_buffer_ref(sd->buf);
+#endif
+
update_image_params(vd, ctx->pic, &mpi->params);
av_frame_unref(ctx->pic);