diff options
author | Dan Oscarsson <DanOscarsson@users.noreply.github.com> | 2024-02-04 09:47:04 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-04 10:01:49 -0600 |
commit | b23e8b2ffb64e315b480f1b10d1a4feb3154f3e2 (patch) | |
tree | c890dc2ff7fd08daf481a4e2bcb835c37547520d /video/out | |
parent | 4ab521f08010329701885d4e383a6de77589a389 (diff) | |
download | mpv-b23e8b2ffb64e315b480f1b10d1a4feb3154f3e2.tar.bz2 mpv-b23e8b2ffb64e315b480f1b10d1a4feb3154f3e2.tar.xz |
vo_vdpau: fix timing for nanoseconds
df764bc0c3926ff06902c2ed8609ed7633408550 and
c82c55b4b9d4015ba79fb36170defb328563cdea blindly converted the units for
this VO since neither of us actually have the hardware/setup to test the
VO. Well it was not actually correct (maybe just one was wrong or both
who knows) since vo_vdpau using timing very differently than all the
other VOs and no one reported on it until just now. Anyways, just apply
this random patch from @DanOscarsson which apparently works for him and
call it a day. Fixes #13397.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_vdpau.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index d6b261f057..8fb46d157b 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -80,7 +80,7 @@ struct vdpctx { struct mp_image *current_image; int64_t current_pts; - int current_duration; + int64_t current_duration; int output_surface_w, output_surface_h; int rotation; @@ -754,8 +754,8 @@ static void flip_page(struct vo *vo) struct vdp_functions *vdp = vc->vdp; VdpStatus vdp_st; - int64_t pts_us = vc->current_pts; - int duration = vc->current_duration; + int64_t pts_ns = vc->current_pts; + int64_t duration = vc->current_duration; vc->dropped_frame = true; // changed at end if false @@ -770,10 +770,8 @@ static void flip_page(struct vo *vo) } vc->vsync_interval = MPMAX(vc->vsync_interval, 1); - if (duration > INT_MAX / 1000) + if (duration > INT_MAX) duration = -1; - else - duration *= 1000; if (vc->vsync_interval == 1) duration = -1; // Make sure drop logic is disabled @@ -782,8 +780,8 @@ static void flip_page(struct vo *vo) vdp_st = vdp->presentation_queue_get_time(vc->flip_queue, &vdp_time); CHECK_VDP_WARNING(vo, "Error when calling vdp_presentation_queue_get_time"); - int64_t rel_pts_ns = (pts_us * 1000) - mp_time_ns(); - if (!pts_us || rel_pts_ns < 0) + int64_t rel_pts_ns = pts_ns - mp_time_ns(); + if (!pts_ns || rel_pts_ns < 0) rel_pts_ns = 0; uint64_t now = vdp_time; |