summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/utils.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-08-18 02:04:29 +0200
committerNiklas Haas <git@haasn.xyz>2017-08-18 02:33:29 +0200
commit01058b16f98d57ed5ce8637731e1d56d44dbcc5c (patch)
treee9ad6caa00925c13f5e0bf446b31da703bac745b /video/out/opengl/utils.c
parentbe05c9eb581f2fb1129088301cc48737b85a65fc (diff)
downloadmpv-01058b16f98d57ed5ce8637731e1d56d44dbcc5c.tar.bz2
mpv-01058b16f98d57ed5ce8637731e1d56d44dbcc5c.tar.xz
vo_opengl: allow texture uploads to fail
Surprisingly makes the code shorter, not longer
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r--video/out/opengl/utils.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c
index 2a120dd5e3..5ef4349fff 100644
--- a/video/out/opengl/utils.c
+++ b/video/out/opengl/utils.c
@@ -126,10 +126,8 @@ bool tex_upload(struct ra *ra, struct tex_upload *pbo, bool want_pbo,
if (!(ra->caps & RA_CAP_DIRECT_UPLOAD))
want_pbo = true;
- if (!want_pbo || params->buf) {
- ra->fns->tex_upload(ra, params);
- return true;
- }
+ if (!want_pbo || params->buf)
+ return ra->fns->tex_upload(ra, params);
struct ra_tex *tex = params->tex;
size_t row_size = tex->params.dimensions == 2 ? params->stride :
@@ -169,8 +167,7 @@ bool tex_upload(struct ra *ra, struct tex_upload *pbo, bool want_pbo,
newparams.buf = buf;
newparams.src = NULL;
- ra->fns->tex_upload(ra, &newparams);
- return true;
+ return ra->fns->tex_upload(ra, &newparams);
}
void tex_upload_uninit(struct ra *ra, struct tex_upload *pbo)