[vlc-commits] commit: Fixed overlay update in directx vout. (Laurent Aimar )
git at videolan.org
git at videolan.org
Mon Jul 19 23:24:36 CEST 2010
vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jul 19 21:45:48 2010 +0200| [24ab47a8a90257c5fe5dd9db99ef77d984e67c5f] | committer: Jean-Baptiste Kempf
Fixed overlay update in directx vout.
IDirectDrawSurface2_UpdateOverlay may fails, in which case vlc should simply
retry later.
(cherry picked from commit d0606472d5a245ec89846d091f5280e51874ed96)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=24ab47a8a90257c5fe5dd9db99ef77d984e67c5f
---
modules/video_output/msw/common.h | 1 +
modules/video_output/msw/directx.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/modules/video_output/msw/common.h b/modules/video_output/msw/common.h
index 463adf6..10988df 100644
--- a/modules/video_output/msw/common.h
+++ b/modules/video_output/msw/common.h
@@ -126,6 +126,7 @@ struct vout_display_sys_t
bool use_wallpaper; /* show as desktop wallpaper ? */
bool use_overlay; /* Are we using an overlay surface */
+ bool restore_overlay;
/* DDraw capabilities */
bool can_blit_fourcc;
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index dae4dda..e7c1cae 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -193,6 +193,7 @@ static int Open(vlc_object_t *object)
sys->use_wallpaper = var_CreateGetBool(vd, "video-wallpaper");
/* FIXME */
sys->use_overlay = false;//var_CreateGetBool(vd, "overlay"); /* FIXME */
+ sys->restore_overlay = false;
var_Create(vd, "directx-device", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
/* Initialisation */
@@ -284,6 +285,8 @@ static void Display(vout_display_t *vd, picture_t *picture)
DirectXUpdateOverlay(vd, NULL);
}
}
+ if (sys->restore_overlay)
+ DirectXUpdateOverlay(vd, NULL);
/* */
DirectXUnlock(picture);
@@ -378,6 +381,10 @@ static void Manage(vout_display_t *vd)
if (ch_wallpaper)
WallpaperChange(vd, wallpaper_requested);
+
+ /* */
+ if (sys->restore_overlay)
+ DirectXUpdateOverlay(vd, NULL);
}
/* */
@@ -1330,6 +1337,8 @@ static int DirectXUpdateOverlay(vout_display_t *vd, LPDIRECTDRAWSURFACE2 surface
HRESULT hr = IDirectDrawSurface2_UpdateOverlay(surface,
&src, sys->display, &dst,
DDOVER_SHOW | DDOVER_KEYDESTOVERRIDE, &ddofx);
+ sys->restore_overlay = hr != DD_OK;
+
if (hr != DD_OK) {
msg_Warn(vd, "DirectDrawUpdateOverlay cannot move/resize overlay");
return VLC_EGENERIC;
More information about the vlc-commits
mailing list