[MPlayer-dev-eng] Gui and 64-bit issues

Bob McElrath mcelrath at draal.physics.wisc.edu
Sun May 19 01:57:48 CEST 2002


There are a couple of 64-bit issues in the gui code.  The player works
great though.  (I just watched a 2 hour divx movie on my alpha! ;)

Basically someone used a "unsigned long" where they meant a 32-bit
quantity.  Patch attached against 0.90pre4.  With this patch the GUI
seems to work fine for me!

Cheers,
-- Bob

Bob McElrath (rsmcelrath at students.wisc.edu) 
Univ. of Wisconsin at Madison, Department of Physics
-------------- next part --------------
diff -cr MPlayer-0.90pre4/Gui/bitmap/bitmap.c MPlayer-0.90pre4.bob/Gui/bitmap/bitmap.c
*** MPlayer-0.90pre4/Gui/bitmap/bitmap.c	Sat May 11 20:09:10 2002
--- MPlayer-0.90pre4.bob/Gui/bitmap/bitmap.c	Sat May 18 17:57:26 2002
***************
*** 185,192 ****
   out->Image=(char *)calloc( 1,out->ImageSize );
   if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
   {
!   int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
!   buf=(unsigned long *)in->Image;
    for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ )
     {
      if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128;
--- 185,192 ----
   out->Image=(char *)calloc( 1,out->ImageSize );
   if ( out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
   {
!   int i,b,c=0; unsigned int * buf = NULL; unsigned char tmp = 0; int nothaveshape = 1;
!   buf=(unsigned int *)in->Image;
    for ( b=0,i=0;i < (int)(out->Width * out->Height);i++ )
     {
      if ( (int)buf[i] != adaptivlimit ) tmp=( tmp >> 1 )|128;
***************
*** 209,216 ****
   mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
   if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
   {
!   int i,b,c=0; unsigned long * buf = NULL; unsigned char tmp = 0;
!   buf=(unsigned long *)out->Image;
    for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ )
     {
      tmp=in->Image[i];
--- 209,216 ----
   mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[c32to1] imagesize: %d\n",out->ImageSize );
   if ( (int)out->Image == NULL ) mp_msg( MSGT_GPLAYER,MSGL_STATUS,"nem van ram baze\n" );
   {
!   int i,b,c=0; unsigned int * buf = NULL; unsigned char tmp = 0;
!   buf=(unsigned int *)out->Image;
    for ( c=0,i=0;i < (int)(in->Width * in->Height / 8);i++ )
     {
      tmp=in->Image[i];
Only in MPlayer-0.90pre4.bob/Gui: config.mak
diff -cr MPlayer-0.90pre4/Gui/mplayer/menu.h MPlayer-0.90pre4.bob/Gui/mplayer/menu.h
*** MPlayer-0.90pre4/Gui/mplayer/menu.h	Wed May  1 04:28:51 2002
--- MPlayer-0.90pre4.bob/Gui/mplayer/menu.h	Sat May 18 18:13:30 2002
***************
*** 9,16 ****
  
  void mplMenuDraw( wsParamDisplay )
  {
!  unsigned long * buf = NULL;
!  unsigned long * drw = NULL;
   int             x,y,tmp;
  
   if ( !appMPlayer.menuBase.Bitmap.Image ) return;
--- 9,16 ----
  
  void mplMenuDraw( wsParamDisplay )
  {
!  unsigned int * buf = NULL;
!  unsigned int * drw = NULL;
   int             x,y,tmp;
  
   if ( !appMPlayer.menuBase.Bitmap.Image ) return;
***************
*** 22,29 ****
  // ---
     if ( mplMenuItem != -1 )
      {
!      buf=(unsigned long *)mplMenuDrawBuffer;
!      drw=(unsigned long *)appMPlayer.menuSelected.Bitmap.Image;
       for ( y=appMPlayer.MenuItems[ mplMenuItem ].y; y < appMPlayer.MenuItems[ mplMenuItem ].y + appMPlayer.MenuItems[ mplMenuItem ].height; y++ )
         for ( x=appMPlayer.MenuItems[ mplMenuItem ].x; x < appMPlayer.MenuItems[ mplMenuItem ].x + appMPlayer.MenuItems[ mplMenuItem ].width; x++ )
           {
--- 22,29 ----
  // ---
     if ( mplMenuItem != -1 )
      {
!      buf=(unsigned int *)mplMenuDrawBuffer;
!      drw=(unsigned int *)appMPlayer.menuSelected.Bitmap.Image;
       for ( y=appMPlayer.MenuItems[ mplMenuItem ].y; y < appMPlayer.MenuItems[ mplMenuItem ].y + appMPlayer.MenuItems[ mplMenuItem ].height; y++ )
         for ( x=appMPlayer.MenuItems[ mplMenuItem ].x; x < appMPlayer.MenuItems[ mplMenuItem ].x + appMPlayer.MenuItems[ mplMenuItem ].width; x++ )
           {
diff -cr MPlayer-0.90pre4/Gui/mplayer/mw.h MPlayer-0.90pre4.bob/Gui/mplayer/mw.h
*** MPlayer-0.90pre4/Gui/mplayer/mw.h	Sat May 11 09:57:31 2002
--- MPlayer-0.90pre4.bob/Gui/mplayer/mw.h	Sat May 18 17:59:47 2002
***************
*** 122,136 ****
  inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
  {
   int i=0,ix,iy;
!  unsigned long * buf = NULL;
!  unsigned long * drw = NULL;
!  unsigned long   tmp;
  
   if ( ( !bf )||( bf->Image == NULL ) ) return;
  
   i=( bf->Width * ( bf->Height / max ) ) * ofs;
!  buf=(unsigned long *)mplDrawBuffer;
!  drw=(unsigned long *)bf->Image;
  
   for ( iy=y;iy < (int)(y+bf->Height / max);iy++ )
    for ( ix=x;ix < (int)(x+bf->Width);ix++ )
--- 122,136 ----
  inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
  {
   int i=0,ix,iy;
!  unsigned int * buf = NULL;
!  unsigned int * drw = NULL;
!  unsigned int   tmp;
  
   if ( ( !bf )||( bf->Image == NULL ) ) return;
  
   i=( bf->Width * ( bf->Height / max ) ) * ofs;
!  buf=(unsigned int *)mplDrawBuffer;
!  drw=(unsigned int *)bf->Image;
  
   for ( iy=y;iy < (int)(y+bf->Height / max);iy++ )
    for ( ix=x;ix < (int)(x+bf->Width);ix++ )
diff -cr MPlayer-0.90pre4/Gui/skin/font.c MPlayer-0.90pre4.bob/Gui/skin/font.c
*** MPlayer-0.90pre4/Gui/skin/font.c	Wed May  1 04:29:00 2002
--- MPlayer-0.90pre4.bob/Gui/skin/font.c	Sat May 18 18:45:37 2002
***************
*** 124,131 ****
   txSample 	 tmp2;
   char            p[512];
   va_list         ap;
!  unsigned long * ibuf;
!  unsigned long * obuf;
   int             i,x,y;
   int             oy = 0, ox = 0, dx = 0;
  
--- 124,131 ----
   txSample 	 tmp2;
   char            p[512];
   va_list         ap;
!  unsigned int * ibuf;
!  unsigned int * obuf;
   int             i,x,y;
   int             oy = 0, ox = 0, dx = 0;
  
***************
*** 144,151 ****
   tmp->ImageSize=tmp->Width * tmp->Height * 4;
   if ( ( tmp->Image=malloc( tmp->ImageSize ) ) ==  NULL ) return NULL;
  
!  obuf=(unsigned long *)tmp->Image;
!  ibuf=(unsigned long *)Fonts[id]->Bitmap.Image;
   for ( i=0;i < (int)strlen( p );i++ )
    {
     char c = p[i];
--- 144,151 ----
   tmp->ImageSize=tmp->Width * tmp->Height * 4;
   if ( ( tmp->Image=malloc( tmp->ImageSize ) ) ==  NULL ) return NULL;
  
!  obuf=(unsigned int *)tmp->Image;
!  ibuf=(unsigned int *)Fonts[id]->Bitmap.Image;
   for ( i=0;i < (int)strlen( p );i++ )
    {
     char c = p[i];
***************
*** 163,170 ****
     tmp2.ImageSize=sx * tmp->Height * 4;
     if ( ( tmp2.Image=malloc( tmp2.ImageSize ) ) ==  NULL ) { free( tmp->Image ); return NULL; }
  
!    obuf=(unsigned long *)tmp->Image;
!    ibuf=(unsigned long *)tmp2.Image;
     oy=0;
  
     for ( y=0;y < tmp->Height;y++ )
--- 163,170 ----
     tmp2.ImageSize=sx * tmp->Height * 4;
     if ( ( tmp2.Image=malloc( tmp2.ImageSize ) ) ==  NULL ) { free( tmp->Image ); return NULL; }
  
!    obuf=(unsigned int *)tmp->Image;
!    ibuf=(unsigned int *)tmp2.Image;
     oy=0;
  
     for ( y=0;y < tmp->Height;y++ )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020518/a9228205/attachment.pgp>


More information about the MPlayer-dev-eng mailing list