[vlc-commits] direct3d9: do not handle VOUT_DISPLAY_RESET_PICTURES anymore
Steve Lhomme
git at videolan.org
Thu Sep 3 07:47:34 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep 2 11:33:31 2020 +0200| [b3f5c68ea1314a4ba5a9659c4b44948c6e1c1ab0] | committer: Steve Lhomme
direct3d9: do not handle VOUT_DISPLAY_RESET_PICTURES anymore
It cannot happen as no VOUT_DISPLAY_CHANGE_xxx can fail anymore. They're just
preparing the picture placement (and possibly moving the internal window).
We can still handle the D3DERR_DEVICENOTRESET case before displaying anything.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b3f5c68ea1314a4ba5a9659c4b44948c6e1c1ab0
---
modules/video_output/win32/direct3d9.c | 28 +++++++---------------------
1 file changed, 7 insertions(+), 21 deletions(-)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 958cdad7f0..93cd647287 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1174,9 +1174,13 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
HRESULT hr = IDirect3DDevice9_TestCooperativeLevel(p_d3d9_dev->dev);
if (FAILED(hr)) {
if (hr == D3DERR_DEVICENOTRESET && !sys->reset_device) {
- if (!is_d3d9_opaque(picture->format.i_chroma))
- vout_display_SendEventPicturesInvalid(vd);
sys->reset_device = true;
+ /* FIXME what to do here in case of failure */
+ if (Direct3D9Reset(vd, &vd->fmt)) {
+ msg_Err(vd, "Failed to reset device");
+ return;
+ }
+ sys->reset_device = false;
sys->lost_not_ready = false;
}
if (hr == D3DERR_DEVICELOST && !sys->lost_not_ready) {
@@ -1688,25 +1692,7 @@ static void Direct3D9Close(vout_display_t *vd)
static int Control(vout_display_t *vd, int query, va_list args)
{
vout_display_sys_t *sys = vd->sys;
-
- switch (query) {
- case VOUT_DISPLAY_RESET_PICTURES:
- {
- /* FIXME what to do here in case of failure */
- if (sys->reset_device) {
- va_arg(args, const vout_display_cfg_t *);
- const video_format_t *fmt = va_arg(args, video_format_t *);
- if (Direct3D9Reset(vd, fmt)) {
- msg_Err(vd, "Failed to reset device");
- return VLC_EGENERIC;
- }
- sys->reset_device = false;
- }
- return VLC_SUCCESS;
- }
- default:
- return CommonControl(vd, &sys->area, &sys->sys, query, args);
- }
+ return CommonControl(vd, &sys->area, &sys->sys, query, args);
}
typedef struct
More information about the vlc-commits
mailing list