summaryrefslogtreecommitdiffstats
path: root/video
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 /video
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 'video')
-rw-r--r--video/out/vo.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index fc4630b731..7db43eaa44 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -163,6 +163,7 @@ struct vo_internal {
uint64_t current_frame_id;
double display_fps;
+ double reported_display_fps;
int opt_framedrop;
};
@@ -533,27 +534,30 @@ static void update_display_fps(struct vo *vo)
mp_read_option_raw(vo->global, "framedrop", &m_option_type_choice,
&in->opt_framedrop);
- double display_fps;
- mp_read_option_raw(vo->global, "display-fps", &m_option_type_double,
- &display_fps);
-
- if (display_fps <= 0)
- vo->driver->control(vo, VOCTRL_GET_DISPLAY_FPS, &display_fps);
+ double fps = 0;
+ vo->driver->control(vo, VOCTRL_GET_DISPLAY_FPS, &fps);
pthread_mutex_lock(&in->lock);
- if (in->display_fps != display_fps) {
- in->display_fps = display_fps;
- MP_VERBOSE(vo, "Assuming %f FPS for display sync.\n", display_fps);
+ in->reported_display_fps = fps;
+ }
- // make sure to update the player
- in->queued_events |= VO_EVENT_WIN_STATE;
- wakeup_core(vo);
- }
+ double display_fps = vo->opts->override_display_fps;
+ if (display_fps <= 0)
+ display_fps = in->reported_display_fps;
- in->nominal_vsync_interval = in->display_fps > 0 ? 1e6 / in->display_fps : 0;
+ if (in->display_fps != display_fps) {
+ in->nominal_vsync_interval = display_fps > 0 ? 1e6 / display_fps : 0;
in->vsync_interval = MPMAX(in->nominal_vsync_interval, 1);
+ in->display_fps = display_fps;
+
+ MP_VERBOSE(vo, "Assuming %f FPS for display sync.\n", display_fps);
+
+ // make sure to update the player
+ in->queued_events |= VO_EVENT_WIN_STATE;
+ wakeup_core(vo);
}
+
pthread_mutex_unlock(&in->lock);
}