]> git.sesse.net Git - vlc/commitdiff
Fixed overlay update in directx vout.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 19 Jul 2010 19:45:48 +0000 (21:45 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 19 Jul 2010 21:14:54 +0000 (23:14 +0200)
IDirectDrawSurface2_UpdateOverlay may fails, in which case vlc should simply
retry later.

modules/video_output/msw/common.h
modules/video_output/msw/directx.c

index 291d8e04bf98dd32271a3bece07e7413e46dd5db..2eb54c91d5304610dc486934e32a1204f621da06 100644 (file)
@@ -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;
index 014a0d0b086eb627e2e2ef83c16d8a06e8c60a4d..b53ea84197aea987fdc74c73f76dbc08ddc5ea99 100644 (file)
@@ -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 */
@@ -285,6 +286,8 @@ static void Display(vout_display_t *vd, picture_t *picture)
                 DirectXUpdateOverlay(vd, NULL);
         }
     }
+    if (sys->restore_overlay)
+        DirectXUpdateOverlay(vd, NULL);
 
     /* */
     DirectXUnlock(picture);
@@ -379,6 +382,10 @@ static void Manage(vout_display_t *vd)
 
     if (ch_wallpaper)
         WallpaperChange(vd, wallpaper_requested);
+
+    /* */
+    if (sys->restore_overlay)
+        DirectXUpdateOverlay(vd, NULL);
 }
 
 /* */
@@ -1355,6 +1362,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;