[vlc-commits] vout: kms: set the picture planes once the picture is created

Steve Lhomme git at videolan.org
Mon Aug 10 08:51:51 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 21 13:54:28 2020 +0200| [779722e9279d70d6e084738472b7cb358b1ee3e1] | committer: Steve Lhomme

vout: kms: set the picture planes once the picture is created

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=779722e9279d70d6e084738472b7cb358b1ee3e1
---

 modules/video_output/kms.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index acbd7ef5d5..3e686e1414 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -578,17 +578,17 @@ static int OpenDisplay(vout_display_t *vd)
 
     picture_resource_t rsc = { 0 };
 
-    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, &rsc);
 
     if (!sys->picture)
         goto err_out;
 
+    for (size_t i = 0; i < PICTURE_PLANE_MAX; 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);



More information about the vlc-commits mailing list