[vlc-devel] [PATCH 17/19] vout: kms: set the picture planes once the picture is created
Steve Lhomme
robux4 at ycbcr.xyz
Thu Jul 30 14:16:58 CEST 2020
---
modules/video_output/kms.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index a9d24f8a7b1..33ca309562b 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -576,19 +576,17 @@ static int OpenDisplay(vout_display_t *vd)
if (!found_connector)
goto err_out;
- picture_resource_t rsc = {};
-
- for (size_t i = 0; i < PICTURE_PLANE_MAX; i++) {
- rsc.p[i].p_pixels = sys->map[0] + sys->offsets[i];
- rsc.p[i].i_lines = sys->height;
- rsc.p[i].i_pitch = sys->stride;
- }
-
- sys->picture = picture_NewFromResource(&vd->fmt, NULL, &rsc);
+ sys->picture = picture_NewFromResource(&vd->fmt, NULL, NULL);
if (!sys->picture)
goto err_out;
+ for (size_t i = 0; i < sys->picture->i_planes; i++) {
+ sys->picture->p[i].p_pixels = sys->map[0] + sys->offsets[i];
+ sys->picture->p[i].i_lines = sys->height;
+ sys->picture->p[i].i_pitch = sys->stride;
+ }
+
return VLC_SUCCESS;
err_out:
drmDropMaster(sys->drm_fd);
--
2.26.2
More information about the vlc-devel
mailing list