[MPlayer-dev-eng] [PATCH] unrarlib on AMD64

Pieter Wuille sipa at ulyssis.org
Sat Apr 16 20:25:04 CEST 2005


Hi,

I noticed that mplayer wasn't able to use rarred vobsub files (v2.71) on my AMD64 system (linux 2.6.11.6 x86_64)
It seemed that unrarlib's urarlib_get() function always returned false.

After some time searching i saw there was a line

  typedef unsigned long    UDWORD;

in unrarlib.h. On a 64-bit system, a long is 64 bits, which isn't really a DWORD. Changing it to
int solved the problem.

Maybe it's dangerous to change it unconditionally to int, because there might be other platforms where
int and long differ in size, but it should really be an int. (I've only tested it on my own system)

Here's the patch:

diff -Naur MPlayer-20050416/unrarlib.h MPlayer-20050416-patched/unrarlib.h
--- MPlayer-20050416/unrarlib.h 2005-04-15 20:48:03.000000000 +0200
+++ MPlayer-20050416-patched/unrarlib.h 2005-04-16 18:17:38.000000000 +0200
@@ -97,13 +97,13 @@
 #ifdef _WIN_32
 typedef unsigned char    UBYTE;             /* WIN32 definitions            */
 typedef unsigned short   UWORD;
-typedef unsigned long    UDWORD;
+typedef unsigned int    UDWORD;
 #endif

 #ifdef _UNIX                                /* LINUX/UNIX definitions       */
 typedef unsigned char    UBYTE;
 typedef unsigned short   UWORD;
-typedef unsigned long    UDWORD;
+typedef unsigned int    UDWORD;
 #endif

Pieter




More information about the MPlayer-dev-eng mailing list