summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-12 23:41:25 +0100
committerwm4 <wm4@nowhere>2015-03-12 23:41:25 +0100
commit9a7fc55607438b60f25c52b0a16341056a99f882 (patch)
tree51dad069366d9d903fed4876d2aa1a83ada394a4
parent209f8225eda88f5b3a56ac37e459e4e9bda01d7e (diff)
downloadmpv-9a7fc55607438b60f25c52b0a16341056a99f882.tar.bz2
mpv-9a7fc55607438b60f25c52b0a16341056a99f882.tar.xz
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.
-rw-r--r--DOCS/man/input.rst6
-rw-r--r--player/command.c8
-rw-r--r--video/out/vo.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index ae5e017d4f..edf00cc752 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -1342,9 +1342,9 @@ Property list
``display-fps``
The refresh rate of the current display. Currently, this is the lowest FPS
of any display covered by the video, as retrieved by the underlying system
- APIs (e.g. xrandr on X11). It is not the measured FPS or the FPS set with
- ``--display-fps``. It's not necessarily available on all platforms. Note
- that any of the listed facts may change any time without a warning.
+ APIs (e.g. xrandr on X11). It is not the measured FPS. It's not necessarily
+ available on all platforms. Note that any of the listed facts may change
+ any time without a warning.
``video-aspect`` (RW)
Video aspect, see ``--video-aspect``.
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,
diff --git a/video/out/vo.c b/video/out/vo.c
index 55ff0b7702..fe53102577 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -312,7 +312,7 @@ static void update_display_fps(struct vo *vo)
pthread_mutex_unlock(&in->lock);
- double display_fps = 1000.0; // assume infinite if unset
+ double display_fps = 1e6; // assume infinite if unset
if (vo->global->opts->frame_drop_fps > 0) {
display_fps = vo->global->opts->frame_drop_fps;
} else {