[MPlayer-dev-eng] [PATCH] big endian compile bug

Steven M. Schultz sms at 2BSD.COM
Tue Dec 9 06:41:01 CET 2003


Hi!

	Ran into this when building on a G4 Powerbook tonight:

gmake -C libmpdemux
cc -c -O4 -mcpu=7450 -mtune=7450 -faltivec -pipe -ffast-math -fomit-frame-pointer -no-cpp-precomp -DSYS_DARWIN -Wl,-bind_at_load -DCONFIG_DARWIN -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I../loader      -o demux_real.o demux_real.c
demux_real.c: In function `demux_open_real':
demux_real.c:1368: error: invalid lvalue in unary `&'
gmake[1]: *** [demux_real.o] Error 1

	line 1368 is a rather ugly looking line ;)

	(char *)&(le2me_32(sh->format)),((unsigned int*)(sh->bih+1))[1],( ...

	Looking at other uses of sh->format it would seem that the fix
	is to not use le2me_32() after the '&'.

	Trivial patch attached which cleared up the compile problem.

	Cheers,
	Steven Schultz
-------------- next part --------------
*** demux_real.c.dist	Mon Dec  8 20:37:17 2003
--- demux_real.c	Mon Dec  8 21:36:14 2003
***************
*** 1364,1370 ****
      if(demuxer->video->sh){
  	sh_video_t *sh=demuxer->video->sh;
  	mp_msg(MSGT_DEMUX,MSGL_INFO,"VIDEO:  %.4s [%08X,%08X]  %dx%d  (aspect %4.2f)  %4.2f fps\n",
! 	    (char *)&(le2me_32(sh->format)),((unsigned int*)(sh->bih+1))[1],((unsigned int*)(sh->bih+1))[0],
  	    sh->disp_w,sh->disp_h,sh->aspect,sh->fps);
      }
  
--- 1364,1370 ----
      if(demuxer->video->sh){
  	sh_video_t *sh=demuxer->video->sh;
  	mp_msg(MSGT_DEMUX,MSGL_INFO,"VIDEO:  %.4s [%08X,%08X]  %dx%d  (aspect %4.2f)  %4.2f fps\n",
! 	    (char *)&sh->format,((unsigned int*)(sh->bih+1))[1],((unsigned int*)(sh->bih+1))[0],
  	    sh->disp_w,sh->disp_h,sh->aspect,sh->fps);
      }
  


More information about the MPlayer-dev-eng mailing list