summaryrefslogtreecommitdiffstats
path: root/video/out/vo.h
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-07 18:15:01 -0500
committerDudemanguy <random342@airmail.cc>2023-09-09 02:48:35 +0000
commitbda84399ab363d3ac5e79fcf6eaa40fcb60f32ae (patch)
tree500414cca2016e6adb44eb9143c35fd98c6bd1eb /video/out/vo.h
parent9c9ec073bd4919239b04cbd9a4a9f86fa177dc65 (diff)
downloadmpv-bda84399ab363d3ac5e79fcf6eaa40fcb60f32ae.tar.bz2
mpv-bda84399ab363d3ac5e79fcf6eaa40fcb60f32ae.tar.xz
vo: change vsync_interval to double
So strangely enough, estimated_vsync_interval is stored as a double but nominal_vsync_interval is not and neither is the vsync_interval. Those are stored as int64_t. This loss of precision can matter even in common cases. For instance, take a typical 60 Hz monitor. Instead of 16666.6666 (repeating) being calculated as the vsync interval, you would get 16666 since the decimals are truncated. This is not really good at all and affects the calculated speed values you get when using display sync. For consistency and better precision, these should all be doubles just like estimated_vsync_interval. Technically this means that we won't be able to store as high of an integer value but such values would be absurdly huge and never actually needed. Also estimated_vsync_interval already can't handle such a case anyway.
Diffstat (limited to 'video/out/vo.h')
-rw-r--r--video/out/vo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 4293dedb1c..518181efb0 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -526,7 +526,7 @@ int vo_query_and_reset_events(struct vo *vo, int events);
struct mp_image *vo_get_current_frame(struct vo *vo);
void vo_set_queue_params(struct vo *vo, int64_t offset_us, int num_req_frames);
int vo_get_num_req_frames(struct vo *vo);
-int64_t vo_get_vsync_interval(struct vo *vo);
+double vo_get_vsync_interval(struct vo *vo);
double vo_get_estimated_vsync_interval(struct vo *vo);
double vo_get_estimated_vsync_jitter(struct vo *vo);
double vo_get_display_fps(struct vo *vo);