1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

vo: better magic value for unknown vsync interval

The value 1 is useful in some contexts, but not such a good choice
otherwise.
This commit is contained in:
wm4 2015-07-01 19:25:13 +02:00
parent 03e062d53e
commit e3d85ad46d
2 changed files with 2 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;