diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2015-02-13 15:22:53 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-02-16 18:09:45 +0900 |
commit | df4d15be7b16f5b83e05dcbca7ccc17567839c1e (patch) | |
tree | 792d15b863db37ff9f00d4d061edaea055151523 /video/out/gl_video.c | |
parent | cb5adf4d726e19e4966362fdf316892da484fefa (diff) | |
download | mpv-df4d15be7b16f5b83e05dcbca7ccc17567839c1e.tar.bz2 mpv-df4d15be7b16f5b83e05dcbca7ccc17567839c1e.tar.xz |
vo_opengl: fix smoothmotion coefficient calculation
Using prev_pts as the start of the scale was plain wrong. Change it to
prev_vsync.
(cherry picked from commit 3931544ef33196e1966c416cc0d60d4160cf27fb)
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index c23e6ac436..1c70d56674 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1749,15 +1749,11 @@ static void gl_video_interpolate_frame(struct gl_video *p, gl->ActiveTexture(GL_TEXTURE0 + 1); gl->BindTexture(p->gl_target, p->surfaces[p->surface_idx].fbotex.texture); gl->ActiveTexture(GL_TEXTURE0); - MP_DBG(p, "frame ppts: %lld, pts: %lld, vsync: %lld, DIFF: %lld\n", - (long long)prev_pts, (long long)t->pts, - (long long)t->next_vsync, (long long)t->next_vsync - t->pts); if (prev_pts < t->next_vsync && t->pts > t->next_vsync) { - double N = t->next_vsync - prev_pts; - double P = t->pts - prev_pts; - double prev_pts_component = N / P; + double N = t->next_vsync - t->prev_vsync; + double P = t->pts - t->prev_vsync; float ts = p->opts.smoothmotion_threshold; - inter_coeff = 1 - prev_pts_component; + inter_coeff = 1 - (N / P); inter_coeff = inter_coeff < 0.0 + ts ? 0.0 : inter_coeff; inter_coeff = inter_coeff > 1.0 - ts ? 1.0 : inter_coeff; MP_DBG(p, "inter frame ppts: %lld, pts: %lld, " |