From 9a7fc55607438b60f25c52b0a16341056a99f882 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 12 Mar 2015 23:41:25 +0100 Subject: command: display-fps is the display FPS as assumed by the VO Requested change in behavior. Note that we set the assumed "infinite" display_fps to 1e6, which conveniently lets vo_get_vsync_interval() return a dummy value of 1, which can be easily checked against, and still avoids doing math with float INFs. --- player/command.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 55cb86cdb8..6fb0ea66d4 100644 --- a/player/command.c +++ b/player/command.c @@ -2601,18 +2601,18 @@ static int mp_property_win_minimized(void *ctx, struct m_property *prop, } static int mp_property_display_fps(void *ctx, struct m_property *prop, - int action, void *arg) + int action, void *arg) { MPContext *mpctx = ctx; struct vo *vo = mpctx->video_out; if (!vo) return M_PROPERTY_UNAVAILABLE; - double fps = 0; - if (vo_control(vo, VOCTRL_GET_DISPLAY_FPS, &fps) < 1 || fps <= 0) + int64_t interval = vo_get_vsync_interval(vo); + if (interval <= 1) return M_PROPERTY_UNAVAILABLE; - return m_property_double_ro(action, arg, fps); + return m_property_double_ro(action, arg, 1e6 / interval); } static int mp_property_display_names(void *ctx, struct m_property *prop, -- cgit v1.2.3