From 7521aac66509d18666b7737160153986cc1437ac Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Fri, 18 Apr 2008 06:28:47 +0300 Subject: Move global vo_config_count to vo struct Remove the global and Add a corresponding field to the vo struct, plus another which tells whether the LAST config call was successful.The latter value which tells whether the VO should be properly configured at the moment seems a better match for the semantics actually needed in most places where the old value was used. The 'count' field with the old semantics is not currently used by anything, but I'm leaving it there for vo drivers which would need those semantics if converted to use the struct. Existing uses of the global outside old vo drivers are either converted to use the struct field or moved inside the vo_xyz() calls (instead of "if (vo_config_count) vo_flip_page(..." just call vo_flip_page which will now do nothing if not configured). The removal of the check in mpcommon.c/update_subtitles() is less trivial than the others, but I think it shouldn't cause problems. --- command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 3f3c25edf1..0b4312aba9 100644 --- a/command.c +++ b/command.c @@ -975,7 +975,7 @@ static int mp_property_fullscreen(m_option_t * prop, int action, void *arg, guiGetEvent(guiIEvent, (char *) MP_CMD_GUI_FULLSCREEN); else #endif - if (vo_config_count) + if (mpctx->video_out->config_ok) vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0); return M_PROPERTY_OK; default: @@ -1064,7 +1064,7 @@ static int mp_property_vo_flag(m_option_t * prop, int action, void *arg, return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - if (vo_config_count) + if (mpctx->video_out->config_ok) vo_control(mpctx->video_out, vo_ctrl, 0); return M_PROPERTY_OK; default: @@ -2892,7 +2892,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) break; case MP_CMD_SCREENSHOT: - if (vo_config_count) { + if (mpctx->video_out && mpctx->video_out->config_ok) { mp_msg(MSGT_CPLAYER, MSGL_INFO, "sending VFCTRL_SCREENSHOT!\n"); if (CONTROL_OK != ((vf_instance_t *) sh_video->vfilter)-> @@ -3037,7 +3037,7 @@ int run_command(MPContext * mpctx, mp_cmd_t * cmd) break; case MP_CMD_GET_VO_FULLSCREEN: - if (mpctx->video_out && vo_config_count) + if (mpctx->video_out && mpctx->video_out->config_ok) mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs); break; -- cgit v1.2.3