[vlc-commits] vdpau: code cleaning

Steve Lhomme git at videolan.org
Wed Nov 20 08:43:03 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Nov 20 08:26:46 2019 +0100| [f0051b25221a5f0fef11ea2e0e2ff6f338b20daa] | committer: Steve Lhomme

vdpau: code cleaning

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

 modules/hw/vdpau/picture.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/hw/vdpau/picture.c b/modules/hw/vdpau/picture.c
index cbc5c21ec4..8e6b545106 100644
--- a/modules/hw/vdpau/picture.c
+++ b/modules/hw/vdpau/picture.c
@@ -62,19 +62,13 @@ static picture_context_t *VideoSurfaceCopy(picture_context_t *ctx)
 {
     vlc_vdp_video_field_t *fold = container_of(ctx, vlc_vdp_video_field_t,
                                                context);
-    vlc_vdp_video_frame_t *frame = fold->frame;
     vlc_vdp_video_field_t *fnew = malloc(sizeof (*fnew));
     if (unlikely(fnew == NULL))
         return NULL;
 
-    fnew->context.destroy = VideoSurfaceDestroy;
-    fnew->context.copy = VideoSurfaceCopy;
-    fnew->frame = frame;
-    fnew->structure = fold->structure;
-    fnew->procamp = fold->procamp;
-    fnew->sharpen = fold->sharpen;
+    *fnew = *fold;
 
-    atomic_fetch_add(&frame->refs, 1);
+    atomic_fetch_add(&fold->frame->refs, 1);
     return &fnew->context;
 }
 
@@ -100,8 +94,9 @@ vlc_vdp_video_field_t *vlc_vdp_video_create(vdp_t *vdp,
         return NULL;
     }
 
-    field->context.destroy = VideoSurfaceDestroy;
-    field->context.copy = VideoSurfaceCopy;
+    field->context = (picture_context_t) {
+        VideoSurfaceDestroy, VideoSurfaceCopy,
+    };
     field->frame = frame;
     field->structure = VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME;
     field->procamp = procamp_default;



More information about the vlc-commits mailing list