summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-11-14 09:24:33 +0100
committerDudemanguy <random342@airmail.cc>2023-11-18 22:54:29 +0000
commitbd1ac498bbcaf47ba73ed442d16ae4982782ed86 (patch)
tree38c90943401ef07d1a042e8b7c96e03a65abaf9e
parent4dcf2d13850ca443d40dd07546b795cd0c231fbe (diff)
downloadmpv-bd1ac498bbcaf47ba73ed442d16ae4982782ed86.tar.bz2
mpv-bd1ac498bbcaf47ba73ed442d16ae4982782ed86.tar.xz
vo_gpu_next: interpolate only if display_synced or a still frame
If !display_synced, some values may not be correct or zeroed. Therefore, it makes no sense to interpolate in this case. For a non-moving frame, we always want to show an uninterpolated frame.
-rw-r--r--video/out/vo_gpu_next.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 14a25073d0..4bf7721723 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -872,7 +872,8 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
const struct gl_video_opts *opts = p->opts_cache->opts;
bool will_redraw = frame->display_synced && frame->num_vsyncs > 1;
bool cache_frame = will_redraw || frame->still;
- bool can_interpolate = opts->interpolation && frame->num_frames > 1;
+ bool can_interpolate = opts->interpolation && frame->display_synced &&
+ !frame->still && frame->num_frames > 1;
params.info_callback = info_callback;
params.info_priv = vo;
params.skip_caching_single_frame = !cache_frame;
@@ -935,7 +936,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
pl_queue_update(p->queue, NULL, pl_queue_params(
.pts = frame->current->pts + pts_offset,
.radius = pl_frame_mix_radius(&params),
- .vsync_duration = frame->ideal_frame_vsync_duration,
+ .vsync_duration = can_interpolate ? frame->ideal_frame_vsync_duration : 0,
#if PL_API_VER >= 340
.drift_compensation = 0,
#endif
@@ -963,7 +964,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame)
struct pl_queue_params qparams = *pl_queue_params(
.pts = frame->current->pts + pts_offset,
.radius = pl_frame_mix_radius(&params),
- .vsync_duration = frame->ideal_frame_vsync_duration,
+ .vsync_duration = can_interpolate ? frame->ideal_frame_vsync_duration : 0,
.interpolation_threshold = opts->interpolation_threshold,
#if PL_API_VER >= 340
.drift_compensation = 0,