diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-09-03 08:44:36 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-09-03 08:44:36 +0000 |
commit | e1e588421fc7e826d6bf65d838d3efb434827210 (patch) | |
tree | f7ba0120d324f77acc33965111ce88051d402f40 /libvo/w32_common.c | |
parent | a522f65ac28f8e4185b5481dc94480666563e077 (diff) | |
download | mpv-e1e588421fc7e826d6bf65d838d3efb434827210.tar.bz2 mpv-e1e588421fc7e826d6bf65d838d3efb434827210.tar.xz |
Remove global vo_hdc, since it is recommended to release a DC as soon as possible.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24334 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r-- | libvo/w32_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index ebd1edb1d9..feafbe59df 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -20,7 +20,6 @@ extern int enable_mouse_movements; static const char* classname = "MPlayer - Media player for Win32"; int vo_vm = 0; -HDC vo_hdc = 0; // last non-fullscreen extends int prev_width; @@ -250,6 +249,7 @@ static void resetMode(void) { static int createRenderingContext(void) { HWND layer = HWND_NOTOPMOST; PIXELFORMATDESCRIPTOR pfd; + HDC vo_hdc = GetDC(vo_window); RECT r; int pf; if (WinID < 0) { @@ -308,6 +308,7 @@ static int createRenderingContext(void) { pf = ChoosePixelFormat(vo_hdc, &pfd); if (!pf) { mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to select a valid pixel format!\n"); + ReleaseDC(vo_hdc); return 0; } @@ -315,6 +316,7 @@ static int createRenderingContext(void) { mp_msg(MSGT_VO, MSGL_V, "vo: win32: running at %dx%d with depth %d\n", vo_screenwidth, vo_screenheight, vo_depthonscreen); + ReleaseDC(vo_hdc); return 1; } @@ -369,8 +371,6 @@ int vo_w32_init(void) { } } - vo_hdc = GetDC(vo_window); - myMonitorFromWindow = NULL; myGetMonitorInfo = NULL; myEnumDisplayMonitors = NULL; |