From 47e92b2f884d4dd831e3e59ae9c692b460ef8dc3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 24 Aug 2013 19:37:34 +0200 Subject: video: handle video output levels with mp_image_params Until now, video output levels (obscure feature, like using TV screens that require RGB output in limited range, similar to YUY) still required handling of VOCTRL_SET_YUV_COLORSPACE. Simplify this, and use the new mp_image_params code. This gets rid of some code. VOCTRL_SET_YUV_COLORSPACE is not needed at all anymore in VOs that use the reconfig callback. The result of VOCTRL_GET_YUV_COLORSPACE is now used only used for the colormatrix related properties (basically, for display on OSD). For other VOs, VOCTRL_SET_YUV_COLORSPACE will be sent only once after config instead of twice. --- mpvcore/mplayer.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mpvcore/mplayer.c') diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c index ed7fbec15e..2d5265d41b 100644 --- a/mpvcore/mplayer.c +++ b/mpvcore/mplayer.c @@ -1800,10 +1800,9 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) assert(track && sh_sub); struct dec_sub *dec_sub = sh_sub->dec_sub; - if (mpctx->sh_video) { - struct mp_image_params params; - if (get_video_params(mpctx->sh_video, ¶ms) > 0) - sub_control(dec_sub, SD_CTRL_SET_VIDEO_PARAMS, ¶ms); + if (mpctx->sh_video && mpctx->sh_video->vf_input) { + struct mp_image_params params = *mpctx->sh_video->vf_input; + sub_control(dec_sub, SD_CTRL_SET_VIDEO_PARAMS, ¶ms); } mpctx->osd->video_offset = track->under_timeline ? mpctx->video_offset : 0; -- cgit v1.2.3