summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vdpau.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-02-04 19:03:18 +0100
committerDudemanguy <random342@airmail.cc>2024-02-07 14:45:07 +0000
commit9ce2bafbe9a49afe65eb86b46625f12dcb1b3110 (patch)
treea7b557a6a43e37177d5832804672593ee0745df9 /video/out/vo_vdpau.c
parent5d8faff9bfff04aea90a6adee8e095b65eb6880c (diff)
downloadmpv-9ce2bafbe9a49afe65eb86b46625f12dcb1b3110.tar.bz2
mpv-9ce2bafbe9a49afe65eb86b46625f12dcb1b3110.tar.xz
vo_vdpau: cosmetic changes to timings
Remove unneded range check. Print time difference with more precision. Use the same data formats for fps and interval as in other VOs.
Diffstat (limited to 'video/out/vo_vdpau.c')
-rw-r--r--video/out/vo_vdpau.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 8fb46d157b..f1f6f3ae71 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -104,9 +104,9 @@ struct vdpctx {
int surface_num; // indexes output_surfaces
int query_surface_num;
VdpTime recent_vsync_time;
- float user_fps;
+ double user_fps;
bool composite_detect;
- int vsync_interval;
+ int64_t vsync_interval;
uint64_t last_queue_time;
uint64_t queue_time[MAX_OUTPUT_SURFACES];
uint64_t last_ideal_time;
@@ -721,12 +721,12 @@ static int update_presentation_queue_status(struct vo *vo)
break;
if (vc->vsync_interval > 1) {
uint64_t qtime = vc->queue_time[vc->query_surface_num];
- int diff = ((int64_t)vtime - (int64_t)qtime) / 1e6;
- MP_TRACE(vo, "Queue time difference: %d ms\n", diff);
+ double diff = MP_TIME_NS_TO_MS((int64_t)vtime - (int64_t)qtime);
+ MP_TRACE(vo, "Queue time difference: %.4f ms\n", diff);
if (vtime < qtime + vc->vsync_interval / 2)
- MP_VERBOSE(vo, "Frame shown too early (%d ms)\n", diff);
+ MP_VERBOSE(vo, "Frame shown too early (%.4f ms)\n", diff);
if (vtime > qtime + vc->vsync_interval)
- MP_VERBOSE(vo, "Frame shown late (%d ms)\n", diff);
+ MP_VERBOSE(vo, "Frame shown late (%.4f ms)\n", diff);
}
vc->query_surface_num = WRAP_ADD(vc->query_surface_num, 1,
vc->num_output_surfaces);
@@ -770,9 +770,6 @@ static void flip_page(struct vo *vo)
}
vc->vsync_interval = MPMAX(vc->vsync_interval, 1);
- if (duration > INT_MAX)
- duration = -1;
-
if (vc->vsync_interval == 1)
duration = -1; // Make sure drop logic is disabled
@@ -1122,7 +1119,7 @@ const struct vo_driver video_out_vdpau = {
{"denoise", OPT_FLOAT(denoise), M_RANGE(0, 1)},
{"sharpen", OPT_FLOAT(sharpen), M_RANGE(-1, 1)},
{"hqscaling", OPT_INT(hqscaling), M_RANGE(0, 9)},
- {"fps", OPT_FLOAT(user_fps)},
+ {"fps", OPT_DOUBLE(user_fps)},
{"composite-detect", OPT_BOOL(composite_detect), OPTDEF_INT(1)},
{"queuetime-windowed", OPT_INT(flip_offset_window), OPTDEF_INT(50)},
{"queuetime-fs", OPT_INT(flip_offset_fs), OPTDEF_INT(50)},