summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-13 12:34:26 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-03-15 23:13:53 -0700
commite42a194062cb29e538f19d12902c1610c1b30aef (patch)
treea0594d9a300160ad2d8dc270a60ab3e753148122 /player
parent2c572e2bb1cfa4e225a6a1599f5ecdbcf4bf2dc6 (diff)
downloadmpv-e42a194062cb29e538f19d12902c1610c1b30aef.tar.bz2
mpv-e42a194062cb29e538f19d12902c1610c1b30aef.tar.xz
vo: move display-fps internal option value to VO opts
Removes the awkward notification through VO_EVENT_WIN_STATE. Unfortunately, some awkwardness remains in mp_property_display_fps(), because the property has conflicting semantics with the option.
Diffstat (limited to 'player')
-rw-r--r--player/command.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/player/command.c b/player/command.c
index 67cc1db250..628dc98a34 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2724,17 +2724,10 @@ 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)
- 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);
+ double fps = mpctx->video_out ? vo_get_display_fps(mpctx->video_out) : 0;
+ if (fps > 0 && action != M_PROPERTY_SET)
+ return m_property_double_ro(action, arg, fps);
+ return mp_property_generic_option(mpctx, prop, action, arg);
}
static int mp_property_framedrop(void *ctx, struct m_property *prop,