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

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


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

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

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

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

diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 2bdcd63d9e..7463fb1a7b 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -244,14 +244,14 @@ static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
 
     sys->pic_opaque = sys->lock(sys->opaque, planes);
 
-    for (unsigned i = 0; i < PICTURE_PLANE_MAX; i++) {
-        rsc.p[i].p_pixels = planes[i];
-        rsc.p[i].i_lines  = sys->lines[i];
-        rsc.p[i].i_pitch  = sys->pitches[i];
-    }
-
     picture_t *locked = picture_NewFromResource(&vd->fmt, &rsc);
     if (likely(locked != NULL)) {
+        for (unsigned i = 0; i < PICTURE_PLANE_MAX; i++) {
+            locked->p[i].p_pixels = planes[i];
+            locked->p[i].i_lines  = sys->lines[i];
+            locked->p[i].i_pitch  = sys->pitches[i];
+        }
+
         picture_CopyPixels(locked, pic);
         picture_Release(locked);
     }



More information about the vlc-commits mailing list