changeset 33807:fb9eaa0ab770

Simplify code handling minimized state.
author reimar
date Sun, 24 Jul 2011 17:23:49 +0000
parents 8c31fd7b9a08
children b69bf18ef92c
files libvo/vo_directx.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Sun Jul 24 17:16:43 2011 +0000
+++ b/libvo/vo_directx.c	Sun Jul 24 17:23:49 2011 +0000
@@ -488,17 +488,20 @@
     rd.right=rd.left+width;
     rd.bottom=rd.top+height;
 
-      if(!nooverlay && (!width || !height)){
-	    /*window is minimized*/
-	    ddrval = g_lpddsOverlay->lpVtbl->UpdateOverlay(g_lpddsOverlay,NULL, g_lpddsPrimary, NULL, DDOVER_HIDE, NULL);
-	    return 0;
-	  }
-
 	/*ok, let's workaround some overlay limitations*/
 	if(!nooverlay)
 	{
 		uint32_t        uStretchFactor1000;  //minimum stretch
         uint32_t        xstretch1000,ystretch1000;
+
+        if (!width || !height) {
+            // window is minimized, so we should hide the overlay in case
+            // colorkeying is not used or working.
+            // In addition trying to set width/height to 0 would crash
+            g_lpddsOverlay->lpVtbl->UpdateOverlay(g_lpddsOverlay, NULL, g_lpddsPrimary, NULL, DDOVER_HIDE, NULL);
+            return 0;
+        }
+
 		/*get driver capabilities*/
         ZeroMemory(&capsDrv, sizeof(capsDrv));
         capsDrv.dwSize = sizeof(capsDrv);