[vlc-devel] [PATCH 3/3] opengl: only allow vout_display_opengl_GetPool() if a custom pool will be used
Steve Lhomme
robux4 at ycbcr.xyz
Tue Jun 25 14:58:30 CEST 2019
---
modules/video_output/opengl/vout_helper.c | 30 ++---------------------
1 file changed, 2 insertions(+), 28 deletions(-)
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index f4c9e5dd83..b37b653257 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -1040,36 +1040,10 @@ picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned
opengl_tex_converter_t *tc = vgl->prgm->tc;
requested_count = __MIN(VLCGL_PICTURE_MAX, requested_count);
/* Allocate with tex converter pool callback if it exists */
- if (tc->pf_get_pool != NULL)
- {
- vgl->pool = tc->pf_get_pool(tc, requested_count);
- if (!vgl->pool)
- goto error;
- return vgl->pool;
- }
-
- /* Allocate our pictures */
- picture_t *picture[VLCGL_PICTURE_MAX] = {NULL, };
- unsigned count;
- for (count = 0; count < requested_count; count++)
- {
- picture[count] = picture_NewFromFormat(&vgl->fmt);
- if (!picture[count])
- break;
- }
- if (count <= 0)
- goto error;
-
- /* Wrap the pictures into a pool */
- vgl->pool = picture_pool_New(count, picture);
+ assert(tc->pf_get_pool != NULL);
+ vgl->pool = tc->pf_get_pool(tc, requested_count);
if (!vgl->pool)
- {
- for (unsigned i = 0; i < count; i++)
- picture_Release(picture[i]);
goto error;
- }
-
- GL_ASSERT_NOERROR();
return vgl->pool;
error:
--
2.17.1
More information about the vlc-devel
mailing list