[MPlayer-cvslog] r24334 - in trunk/libvo: gl_common.c w32_common.c

JonY 10walls at gmail.com
Mon Sep 3 14:28:33 CEST 2007


JonY wrote:
> Hi, this seem to break Windows MinGW build. ReleaseDC needs 2 arguments.
> 
> gcc -pipe -I../libavcodec -I../libavformat -Wdisabled-optimization 
> -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../libavutil 
> -W -Wall -O2 -march=i486 -mtune=generic -pipe -g  -D_LARGEFILE_SOURCE 
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -I/f/live 
> -I/mingw/include/ -I/mingw/include/SDL -D_GNU_SOURCE=1 
> -I/mingw/include/freetype2 -I/mingw/include -I/mingw/include 
> -I/mingw/include -I/mingw/include/dvdnav -I/mingw/include/dvdread   -c 
> -o gl_common.o gl_common.c
> gl_common.c: In function 'setNull':
> gl_common.c:250: warning: unused parameter 's'
> gl_common.c: At top level:
> gl_common.c:261: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:262: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:263: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:264: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:265: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:266: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:267: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:268: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:269: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:270: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:271: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:272: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:273: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:274: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:275: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:276: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:277: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:278: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:279: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:280: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:281: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:282: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:283: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:284: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:285: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:286: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:287: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> gl_common.c:288: warning: missing initializer
> gl_common.c:288: warning: (near initialization for 'extfuncs[27].extstr')
> gl_common.c: In function 'setGlWindow':
> gl_common.c:1394: warning: passing argument 1 of 'ReleaseDC' from 
> incompatible pointer type
> gl_common.c:1394: error: too few arguments to function 'ReleaseDC'
> gl_common.c: In function 'swapGlBuffers':
> gl_common.c:1410: warning: passing argument 1 of 'ReleaseDC' from 
> incompatible pointer type
> gl_common.c:1410: error: too few arguments to function 'ReleaseDC'
> make[1]: *** [gl_common.o] Error 1
> make[1]: Leaving directory `/mplayer/libvo'
> make: *** [libvo/libvo.a] Error 2
> 

This patch seems to fix it. Can anybody test this?

Index: libvo/w32_common.c
===================================================================
--- libvo/w32_common.c  (revision 24334)
+++ libvo/w32_common.c  (working copy)
@@ -308,7 +308,7 @@
      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);
+        ReleaseDC(vo_window,vo_hdc);
          return 0;
      }

@@ -316,7 +316,7 @@

      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);
+    ReleaseDC(vo_window,vo_hdc);
      return 1;
  }

Index: libvo/gl_common.c
===================================================================
--- libvo/gl_common.c   (revision 24334)
+++ libvo/gl_common.c   (working copy)
@@ -1391,7 +1391,7 @@
      res = SET_WINDOW_OK;

  out:
-  ReleaseDC(windc);
+  ReleaseDC(vo_w32_window,windc);
    return res;
  }

@@ -1407,7 +1407,7 @@
  void swapGlBuffers() {
    HDC vo_hdc = GetDC(vo_w32_window);
    SwapBuffers(vo_hdc);
-  ReleaseDC(vo_hdc);
+  ReleaseDC(vo_w32_window,vo_hdc);
  }
  #else
  #ifdef HAVE_LIBDL
Index: libvo/vo_gl2.c
===================================================================
--- libvo/vo_gl2.c      (revision 24334)
+++ libvo/vo_gl2.c      (working copy)
@@ -101,6 +101,7 @@
  {
  #ifdef GL_WIN32
    PIXELFORMATDESCRIPTOR pfd;
+  HDC vo_hdc = GetDC(vo_window);
    int pf = GetPixelFormat(vo_hdc);
    if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) {
      r_sz = g_sz = b_sz = a_sz = 0;




More information about the MPlayer-cvslog mailing list