[vlc-devel] [PATCH 4/4] direct3d11: always place the picture based on the quad source dimensions
Rémi Denis-Courmont
remi at remlab.net
Fri Aug 4 17:52:56 CEST 2017
Le tiistaina 1. elokuuta 2017, 15.30.03 EEST Steve Lhomme a écrit :
> They may not always be equal to the vd->fmt.
>
> --
> replaces https://patches.videolan.org/patch/17703/
> - use macros for the common fields to save/restore to avoid typos
> ---
> modules/video_output/win32/direct3d11.c | 26 ++++++++++++++++++++++----
> 1 file changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/modules/video_output/win32/direct3d11.c
> b/modules/video_output/win32/direct3d11.c index 6a6ca49674..ff1466a857
> 100644
> --- a/modules/video_output/win32/direct3d11.c
> +++ b/modules/video_output/win32/direct3d11.c
> @@ -1054,6 +1054,15 @@ static inline bool RectEquals(const RECT *r1, const
> RECT *r2) r1->left == r2->left && r1->right == r2->right;
> }
>
> +#define BEFORE_UPDATE_RECTS \
> + unsigned int i_outside_width = vd->fmt.i_width; \
> + unsigned int i_outside_height = vd->fmt.i_height; \
> + vd->fmt.i_width = vd->sys->picQuad.i_width; \
> + vd->fmt.i_height = vd->sys->picQuad.i_height;
> +#define AFTER_UPDATE_RECTS \
> + vd->fmt.i_width = i_outside_width; \
> + vd->fmt.i_height = i_outside_height;
As you know, I don´t care much for the DX code. But I have to recommend
against expansion-unsafe macros anyway.
--
雷米‧德尼-库尔蒙
https://www.remlab.net/
More information about the vlc-devel
mailing list