[vlc-commits] avcodec: vdpau: use the decoder device to get the vdp_t*

Steve Lhomme git at videolan.org
Wed Oct 9 10:16:17 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 19 11:41:59 2019 +0200| [36428a415f3d0f96b76ffa816d012295674319ee] | committer: Steve Lhomme

avcodec: vdpau: use the decoder device to get the vdp_t*

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

 modules/hw/vdpau/avcodec.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 3c8317ca12..3bf13e56b0 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -35,6 +35,7 @@
 #include <vlc_plugin.h>
 #include <vlc_fourcc.h>
 #include <vlc_picture.h>
+#include <vlc_codec.h>
 #include <vlc_xlib.h>
 #include "vlc_vdpau.h"
 #include "../../codec/avcodec/va.h"
@@ -177,13 +178,8 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *d
     sys->width = width;
     sys->height = height;
     sys->hwaccel_context = NULL;
-
-    err = vdp_get_x11(NULL, -1, &sys->vdp, &sys->device);
-    if (err != VDP_STATUS_OK)
-    {
-        free(sys);
-        return VLC_EGENERIC;
-    }
+    sys->vdp = dec_device->opaque;
+    vdp_hold_x11(sys->vdp, &sys->device);
 
     unsigned flags = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH;
 



More information about the vlc-commits mailing list