diff options
author | Niklas Haas <git@haasn.xyz> | 2017-08-11 04:53:25 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.xyz> | 2017-08-18 00:19:14 +0200 |
commit | 82093764684a4c11f9ad0d8c12bf2e34758ea0fe (patch) | |
tree | 50c7f602327d3a67c76ca094f2f787b8c700e924 /video/out | |
parent | 1171f92beb4fd89e1ba4e76c9b0accacca36a32d (diff) | |
download | mpv-82093764684a4c11f9ad0d8c12bf2e34758ea0fe.tar.bz2 mpv-82093764684a4c11f9ad0d8c12bf2e34758ea0fe.tar.xz |
vo_opengl: make ra_fns.timer_create optional
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/ra.h | 2 | ||||
-rw-r--r-- | video/out/opengl/utils.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/video/out/opengl/ra.h b/video/out/opengl/ra.h index 00d631b93e..d7686bce5f 100644 --- a/video/out/opengl/ra.h +++ b/video/out/opengl/ra.h @@ -382,7 +382,7 @@ struct ra_fns { const struct ra_renderpass_run_params *params); // Create a timer object. Returns NULL on failure, or if timers are - // unavailable. + // unavailable for some reason. Optional. ra_timer *(*timer_create)(struct ra *ra); void (*timer_destroy)(struct ra *ra, ra_timer *timer); diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index a0174e8063..64421b73a8 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -134,6 +134,9 @@ struct timer_pool { struct timer_pool *timer_pool_create(struct ra *ra) { + if (!ra->fns->timer_create) + return NULL; + ra_timer *timer = ra->fns->timer_create(ra); if (!timer) return NULL; |