# HG changeset patch # User reimar # Date 1311528229 0 # Node ID fb9eaa0ab770d60dd239a959ab5e259dd1e5e28a # Parent 8c31fd7b9a08244ccaa01c16eaa50039e112063d Simplify code handling minimized state. diff -r 8c31fd7b9a08 -r fb9eaa0ab770 libvo/vo_directx.c --- 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);