[vlc-commits] d3d11va: fix the internal pool use with direct decode builds

Steve Lhomme git at videolan.org
Tue Jun 13 14:59:26 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed May 17 14:30:22 2017 +0200| [5f6a6f47a6d0cf475fd965a93f3ae53c4b76e283] | committer: Jean-Baptiste Kempf

d3d11va: fix the internal pool use with direct decode builds

ie builds with recent libavcodec
There is still an issue with the internal pool as the ouput picture in Extract
may not be allocated by the proper vout and therefore lack the proper
picture_sys_t data.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/d3d11va.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index a5ca9e5e91..cfec0e0ed8 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -293,6 +293,12 @@ static int Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
 {
 #if D3D11_DIRECT_DECODE
     picture_sys_t *p_sys = pic->p_sys;
+    if (p_sys == NULL)
+    {
+        assert(!va->sys->b_extern_pool);
+        return directx_va_Get(va, &va->sys->dx_sys, pic, data);
+    }
+
     if (p_sys->decoder == NULL)
     {
         HRESULT hr;
@@ -439,7 +445,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     va->setup   = Setup;
     va->get     = Get;
 #if D3D11_DIRECT_DECODE
-    va->release = NULL;
+    va->release = sys->b_extern_pool ? NULL : directx_va_Release;
 #else
     va->release = directx_va_Release;
 #endif



More information about the vlc-commits mailing list