[vlc-commits] d3d9_fmt: add a helper function to find the actual picture_sys_t to use

Steve Lhomme git at videolan.org
Sat Jul 1 18:29:33 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Jun 26 15:14:41 2017 +0200| [66635182bf34830577ab711207e4772ab5c05d6a] | committer: Jean-Baptiste Kempf

d3d9_fmt: add a helper function to find the actual picture_sys_t to use

the decoder and filters fill context but the vout uses picture_sys_t by default

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

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

 modules/video_chroma/d3d9_fmt.h | 6 ++++++
 modules/video_chroma/dxa9.c     | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index eb9a1ac9b5..840ecb56e8 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -33,6 +33,12 @@ struct picture_sys_t
 
 #include "../codec/avcodec/va_surface.h"
 
+static inline picture_sys_t *ActivePictureSys(picture_t *p_pic)
+{
+    struct va_pic_context *pic_ctx = (struct va_pic_context*)p_pic->context;
+    return pic_ctx ? &pic_ctx->picsys : p_pic->p_sys;
+}
+
 static inline void AcquirePictureSys(picture_sys_t *p_sys)
 {
     IDirect3DSurface9_AddRef(p_sys->surface);
diff --git a/modules/video_chroma/dxa9.c b/modules/video_chroma/dxa9.c
index 611ef9b296..e15ea86b0b 100644
--- a/modules/video_chroma/dxa9.c
+++ b/modules/video_chroma/dxa9.c
@@ -56,7 +56,7 @@ struct filter_sys_t {
 static bool GetLock(filter_t *p_filter, LPDIRECT3DSURFACE9 d3d,
                     D3DLOCKED_RECT *p_lock, D3DSURFACE_DESC *p_desc)
 {
-    if (FAILED( IDirect3DSurface9_GetDesc(d3d, p_desc)))
+    if (unlikely(FAILED( IDirect3DSurface9_GetDesc(d3d, p_desc))))
         return false;
 
     /* */



More information about the vlc-commits mailing list