summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-25 00:47:53 +0100
committerwm4 <wm4@nowhere>2019-11-25 00:47:53 +0100
commit3a2dc8b22e9f947c9cd3a91445b0731b8df1d798 (patch)
tree830404c6eeffd7c5ee9c7664d574cba84e7f8511 /player/command.c
parentc26e80d0fd1a751bac1674e5c0792b11eb57957d (diff)
downloadmpv-3a2dc8b22e9f947c9cd3a91445b0731b8df1d798.tar.bz2
mpv-3a2dc8b22e9f947c9cd3a91445b0731b8df1d798.tar.xz
command, options: deprecate old --display-fps behavior
See changelog and manpage changes. (So much effort to fix an ancient dumb mistake for an option nobody should use anyway.)
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 9cd7ef2fc6..bb9696801d 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2445,9 +2445,27 @@ static int mp_property_display_fps(void *ctx, struct m_property *prop,
{
MPContext *mpctx = ctx;
double fps = mpctx->video_out ? vo_get_display_fps(mpctx->video_out) : 0;
- if (fps > 0 && action != M_PROPERTY_SET)
+ switch (action) {
+ case M_PROPERTY_SET: {
+ MP_WARN(mpctx, "Setting the display-fps property is deprecated; set "
+ "the override-display-fps property instead.\n");
+ struct mpv_node val = {
+ .format = MPV_FORMAT_DOUBLE,
+ .u.double_ = *(double *)arg,
+ };
+ return m_config_set_option_node(mpctx->mconfig,
+ bstr0("override-display-fps"), &val, 0)
+ >= 0 ? M_PROPERTY_OK : M_PROPERTY_ERROR;
+ }
+ case M_PROPERTY_GET:
+ if (fps <= 0)
+ return M_PROPERTY_UNAVAILABLE;
return m_property_double_ro(action, arg, fps);
- return mp_property_generic_option(mpctx, prop, action, arg);
+ case M_PROPERTY_GET_TYPE:
+ *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_DOUBLE};
+ return M_PROPERTY_OK;
+ }
+ return M_PROPERTY_NOT_IMPLEMENTED;
}
static int mp_property_estimated_display_fps(void *ctx, struct m_property *prop,