summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-09 13:52:46 +0100
committerwm4 <wm4@nowhere>2015-11-09 13:59:25 +0100
commit8baf773d0e9a02febde5a64c722a9bc233acff6e (patch)
treeeff9a686d3cd753bd658fe6b522dcf57cbbc65d8 /player/command.c
parent11888a927035c37759cddcbbb588c4f8b93296d1 (diff)
downloadmpv-8baf773d0e9a02febde5a64c722a9bc233acff6e.tar.bz2
mpv-8baf773d0e9a02febde5a64c722a9bc233acff6e.tar.xz
command: make display-fps property writable
Has the same function as setting the option. This commit changes the property in a bunch of other ways. For example if the VO is not created, it will return the option value.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/player/command.c b/player/command.c
index 27912354a5..6473de4af9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2574,14 +2574,16 @@ static int mp_property_display_fps(void *ctx, struct m_property *prop,
int action, void *arg)
{
MPContext *mpctx = ctx;
+ double fps = mpctx->opts->frame_drop_fps;
struct vo *vo = mpctx->video_out;
- if (!vo)
- return M_PROPERTY_UNAVAILABLE;
-
- double fps = vo_get_display_fps(vo);
- if (fps < 1)
- return M_PROPERTY_UNAVAILABLE;
-
+ if (vo)
+ fps = vo_get_display_fps(vo);
+ if (action == M_PROPERTY_SET) {
+ int ret = mp_property_generic_option(mpctx, prop, action, arg);
+ if (vo)
+ vo_event(vo, VO_EVENT_WIN_STATE);
+ return ret;
+ }
return m_property_double_ro(action, arg, fps);
}