summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/dec_video.c
diff options
context:
space:
mode:
authorcantabile <cantabile.desu@gmail.com>2012-08-21 00:03:59 +0300
committerwm4 <wm4@nowhere>2012-08-21 18:17:41 +0200
commita1380f394597e06e04195b1812300550f3c2df40 (patch)
treedb2303737c451586f1f427e0f3b562f1c7f0dade /libmpcodecs/dec_video.c
parent27262dec1be623618a2e55ab1dbc35371e0ec758 (diff)
downloadmpv-a1380f394597e06e04195b1812300550f3c2df40.tar.bz2
mpv-a1380f394597e06e04195b1812300550f3c2df40.tar.xz
video: honor the video's colormatrix and color range flags
If either of them is not defined, the old behavior is used: - the colormatrix is guessed based on resolution. - the color range is assumed to be tv aka limited range.
Diffstat (limited to 'libmpcodecs/dec_video.c')
-rw-r--r--libmpcodecs/dec_video.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c
index 148514db95..e328f3e948 100644
--- a/libmpcodecs/dec_video.c
+++ b/libmpcodecs/dec_video.c
@@ -129,9 +129,15 @@ void get_detected_video_colorspace(struct sh_video *sh, struct mp_csp_details *c
csp->levels_out = opts->requested_output_range;
if (csp->format == MP_CSP_AUTO)
+ csp->format = sh->colorspace;
+ if (csp->format == MP_CSP_AUTO)
csp->format = mp_csp_guess_colorspace(vf->w, vf->h);
+
+ if (csp->levels_in == MP_CSP_LEVELS_AUTO)
+ csp->levels_in = sh->color_range;
if (csp->levels_in == MP_CSP_LEVELS_AUTO)
csp->levels_in = MP_CSP_LEVELS_TV;
+
if (csp->levels_out == MP_CSP_LEVELS_AUTO)
csp->levels_out = MP_CSP_LEVELS_PC;
}