From e3d85ad46dfbe8398b5e8573739b5f7222b7f1fe Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 1 Jul 2015 19:25:13 +0200 Subject: vo: better magic value for unknown vsync interval The value 1 is useful in some contexts, but not such a good choice otherwise. --- video/out/vo.c | 2 +- video/out/vo_vdpau.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/video/out/vo.c b/video/out/vo.c index 920fb00e6b..e03134c561 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -985,7 +985,7 @@ int64_t vo_get_vsync_interval(struct vo *vo) { struct vo_internal *in = vo->in; pthread_mutex_lock(&in->lock); - int64_t res = vo->in->vsync_interval; + int64_t res = vo->in->vsync_interval > 1 ? vo->in->vsync_interval : -1; pthread_mutex_unlock(&in->lock); return res; } diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index bcee3daba2..2e513e91bd 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -723,6 +723,7 @@ static void flip_page(struct vo *vo) } else if (vc->user_fps == 0) { vc->vsync_interval = vo_get_vsync_interval(vo) * 1000; } + vc->vsync_interval = MPMAX(vc->vsync_interval, 1); if (duration > INT_MAX / 1000) duration = -1; -- cgit v1.2.3