d3d9: don't store the adapter ID twice in the decoder device
authorSteve Lhomme <robux4@ycbcr.xyz>
Thu, 21 Nov 2019 09:08:30 +0000 (10:08 +0100)
committerSteve Lhomme <robux4@ycbcr.xyz>
Thu, 21 Nov 2019 12:25:18 +0000 (13:25 +0100)
modules/codec/avcodec/dxva2.c
modules/hw/d3d9/d3d9_device.c
modules/video_chroma/d3d9_fmt.h
modules/video_output/win32/direct3d9.c

index fa58161..b67e9ce 100644 (file)
@@ -266,7 +266,7 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
     if (unlikely(sys == NULL))
         return VLC_ENOMEM;
 
-    HRESULT hr = D3D9_CreateDevice(va, &d3d9_decoder->hd3d, d3d9_decoder->adapter, &sys->d3d_dev);
+    HRESULT hr = D3D9_CreateDevice(va, &d3d9_decoder->hd3d, d3d9_decoder->d3ddev.adapterId, &sys->d3d_dev);
     if ( FAILED(hr) )
     {
         free( sys );
index 5bc8e23..fd205f3 100644 (file)
@@ -110,7 +110,6 @@ int D3D9OpenDecoderDevice(vlc_decoder_device *device, vout_window_t *wnd)
         D3D9_Destroy( &sys->dec_device.hd3d );
         goto error;
     }
-    sys->dec_device.adapter = sys->dec_device.d3ddev.adapterId;
 
     device->ops = &d3d9_dev_ops;
     device->opaque = &sys->dec_device;
index 35edc37..23c75f6 100644 (file)
@@ -74,7 +74,6 @@ typedef struct
 {
     d3d9_handle_t  hd3d;
     d3d9_device_t  d3ddev;
-    int            adapter;
 } d3d9_decoder_device_t;
 
 typedef struct
index e73eba5..91996fa 100644 (file)
@@ -1674,7 +1674,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
             sys->d3d9_device = NULL;
             goto error;
         }
-        sys->d3d9_device->adapter = -1;
+        sys->d3d9_device->d3ddev.adapterId = -1;
     }
 
     d3d9_video_context_t *octx = GetD3D9ContextPrivate(context);
@@ -1682,7 +1682,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     if (octx != NULL)
         hr = D3D9_CreateDeviceExternal(octx->dev, &sys->d3d9_device->hd3d, &sys->d3d_dev);
     else
-        hr = D3D9_CreateDevice(vd, &sys->d3d9_device->hd3d, sys->d3d9_device->adapter, &sys->d3d_dev);
+        hr = D3D9_CreateDevice(vd, &sys->d3d9_device->hd3d, sys->d3d9_device->d3ddev.adapterId, &sys->d3d_dev);
 
     if (FAILED(hr)) {
         msg_Err( vd, "D3D9 Creation failed! (hr=0x%lX)", hr);