summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl_cb.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-04 14:26:28 +0100
committerwm4 <wm4@nowhere>2015-11-04 21:49:54 +0100
commite6a395c2979689761a5d86bdf1863530f5553f9d (patch)
tree4be9c1413287ef9cf5227c0425874de440d7fbdd /video/out/vo_opengl_cb.c
parentbe49da72ea245e2b5227ce4b96b6c2c8f360cfaf (diff)
downloadmpv-e6a395c2979689761a5d86bdf1863530f5553f9d.tar.bz2
mpv-e6a395c2979689761a5d86bdf1863530f5553f9d.tar.xz
vo_opengl, vo_opengl_cb: drop unneeded vo_frame fields
next_vsync/prev_vsync was only used to retrieve the vsync duration. We can get this in a simpler way. This also removes the vsync duration estimation from vo_opengl_cb.c, which is probably worthless anyway. (And once interpolation is made display-sync only, this won't matter at all.)
Diffstat (limited to 'video/out/vo_opengl_cb.c')
-rw-r--r--video/out/vo_opengl_cb.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 2be18bb7d7..179fbce684 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -81,7 +81,6 @@ struct mpv_opengl_cb_context {
bool eq_changed;
struct mp_csp_equalizer eq;
int64_t recent_flip;
- int64_t approx_vsync;
bool frozen; // libmpv user is not redrawing frames
struct vo *active;
int hwdec_api;
@@ -284,16 +283,6 @@ int mpv_opengl_cb_uninit_gl(struct mpv_opengl_cb_context *ctx)
return 0;
}
-// needs lock
-static int64_t prev_sync(mpv_opengl_cb_context *ctx, int64_t ts)
-{
- int64_t diff = (int64_t)(ts - ctx->recent_flip);
- int64_t offset = diff % ctx->approx_vsync;
- if (offset < 0)
- offset += ctx->approx_vsync;
- return ts - offset;
-}
-
int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
{
assert(ctx->renderer);
@@ -370,11 +359,6 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
if (!frame)
frame = &dummy;
- if (ctx->approx_vsync > 0) {
- frame->prev_vsync = prev_sync(ctx, mp_time_us());
- frame->next_vsync = frame->prev_vsync + ctx->approx_vsync;
- }
-
pthread_mutex_unlock(&ctx->lock);
gl_video_render_frame(ctx->renderer, frame, fbo);
@@ -396,10 +380,7 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
int mpv_opengl_cb_report_flip(mpv_opengl_cb_context *ctx, int64_t time)
{
pthread_mutex_lock(&ctx->lock);
- int64_t next = time > 0 ? time : mp_time_us();
- if (ctx->recent_flip)
- ctx->approx_vsync = next - ctx->recent_flip;
- ctx->recent_flip = next;
+ ctx->recent_flip = time > 0 ? time : mp_time_us();
pthread_mutex_unlock(&ctx->lock);
return 0;