diff mbox

[FFmpeg-devel] avutil/hwcontext_d3d11va: fix type arguments passed to IDXGIAdapter2_GetDesc()

Message ID 20180723234744.11228-1-jamrial@gmail.com
State Accepted
Commit 81a18f219e2ca0ec57144805dece1b72b73c692d
Headers show

Commit Message

James Almer July 23, 2018, 11:47 p.m. UTC
libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-Wincompatible-pointer-types]
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
                                              ^
libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/hwcontext_d3d11va.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jean-Baptiste Kempf July 24, 2018, 4:06 p.m. UTC | #1
LGTM.

DXGI_ADAPTER_DESC2 should only be used for  IDXGIAdapter2::GetDesc2()

On Tue, 24 Jul 2018, at 01:47, James Almer wrote:
> libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
> libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 
> 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-
> Wincompatible-pointer-types]
>          hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
>                                               ^
> libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC 
> * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 
> 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavutil/hwcontext_d3d11va.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/
> hwcontext_d3d11va.c
> index b68d262804..41330f0ae6 100644
> --- a/libavutil/hwcontext_d3d11va.c
> +++ b/libavutil/hwcontext_d3d11va.c
> @@ -550,7 +550,7 @@ static int d3d11va_device_create(AVHWDeviceContext 
> *ctx, const char *device,
>      }
>  
>      if (pAdapter) {
> -        DXGI_ADAPTER_DESC2 desc;
> +        DXGI_ADAPTER_DESC desc;
>          hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
>          if (!FAILED(hr)) {
>              av_log(ctx, AV_LOG_INFO, "Using device %04x:%04x (%ls).\n",
> -- 
> 2.18.0
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
James Almer July 25, 2018, 6:41 p.m. UTC | #2
On 7/24/2018 1:06 PM, Jean-Baptiste Kempf wrote:
> LGTM.
> 
> DXGI_ADAPTER_DESC2 should only be used for  IDXGIAdapter2::GetDesc2()

Pushed, thanks.
diff mbox

Patch

diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index b68d262804..41330f0ae6 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -550,7 +550,7 @@  static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device,
     }
 
     if (pAdapter) {
-        DXGI_ADAPTER_DESC2 desc;
+        DXGI_ADAPTER_DESC desc;
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
         if (!FAILED(hr)) {
             av_log(ctx, AV_LOG_INFO, "Using device %04x:%04x (%ls).\n",