From 0ecd57d4b26500c662c398e3be2cfe316cee2431 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Jul 2013 01:04:49 +0200 Subject: video: unify colorspace setup Guess the colorspace directly in mpcodecs_reconfig_vo(), instead of in set_video_colorspace(). The difference is that the latter function just makes the video filter chain (and VOs) force the detected colorspace, and then throws it away, while the former is a bit more general and central. Not really a big difference and it doesn't matter much in practice, but it guarantees that there is no internal disagreement about the colorspace. --- video/decode/vd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video/decode/vd.c') diff --git a/video/decode/vd.c b/video/decode/vd.c index 9df1d39146..b344491c6b 100644 --- a/video/decode/vd.c +++ b/video/decode/vd.c @@ -152,6 +152,8 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params) p.d_w = d_w; p.d_h = d_h; + mp_image_params_guess_csp(&p); + vocfg_flags = (opts->fullscreen ? VOFLAG_FULLSCREEN : 0) | (flip ? VOFLAG_FLIPPING : 0); @@ -171,8 +173,9 @@ int mpcodecs_reconfig_vo(sh_video_t *sh, const struct mp_image_params *params) sh->vf_initialized = 1; - sh->colorspace = p.colorspace; - sh->color_range = p.colorlevels; + if (!sh->vf_input) + sh->vf_input = talloc(sh, struct mp_image_params); + *sh->vf_input = p; set_video_colorspace(sh); -- cgit v1.2.3