diff options
author | Niklas Haas <git@nand.wakku.to> | 2015-02-28 01:42:04 +0100 |
---|---|---|
committer | Niklas Haas <git@nand.wakku.to> | 2015-02-28 01:42:04 +0100 |
commit | e141caa97dade07f4d7e0d6c208bcd3493e712ed (patch) | |
tree | 0ce51f8fdf508aee05a96d09484695127f0a130e /video | |
parent | 653b0dd5295453d9661f673b4ebd02c5ceacf645 (diff) | |
download | mpv-e141caa97dade07f4d7e0d6c208bcd3493e712ed.tar.bz2 mpv-e141caa97dade07f4d7e0d6c208bcd3493e712ed.tar.xz |
vd_lavc: respect lavc's color_trc field
We now actually use the TRC tagging information lavc provides us with,
instead of always manually guessing.
Diffstat (limited to 'video')
-rw-r--r-- | video/csputils.h | 2 | ||||
-rw-r--r-- | video/decode/vd_lavc.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/video/csputils.h b/video/csputils.h index b84a4a3544..a082682e43 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -203,6 +203,8 @@ enum mp_csp_levels avcol_range_to_mp_csp_levels(int avrange); enum mp_csp_prim avcol_pri_to_mp_csp_prim(int avpri); +enum mp_csp_trc avcol_trc_to_mp_csp_trc(int avtrc); + int mp_csp_to_avcol_spc(enum mp_csp colorspace); int mp_csp_levels_to_avcol_range(enum mp_csp_levels range); diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 9e0a778990..e32ff6b01e 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -477,6 +477,7 @@ static void update_image_params(struct dec_video *vd, AVFrame *frame, .colorspace = avcol_spc_to_mp_csp(ctx->avctx->colorspace), .colorlevels = avcol_range_to_mp_csp_levels(ctx->avctx->color_range), .primaries = avcol_pri_to_mp_csp_prim(ctx->avctx->color_primaries), + .gamma = avcol_trc_to_mp_csp_trc(ctx->avctx->color_trc), .chroma_location = avchroma_location_to_mp(ctx->avctx->chroma_sample_location), .rotate = vd->header->video->rotate, |